sogwhite / flying-saucer

Automatically exported from code.google.com/p/flying-saucer
0 stars 0 forks source link

'-fs-fit-images-to-width' in a table cell does not render the image #228

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
If I process the attached test.xhtml file through flying saucer, no image is 
shown in the left cell.  However, if I comment out the CSS:

-fs-fit-images-to-width: 100%;

then the image is displayed, but because it's size is not constrained it is 
only partially visible on the page and the right cell with the text is not 
visible at all.

If I change the table to be floating divs instead, then the page is rendered 
with the scaled image as expected, but I need to use tables as I need the cells 
to be the same height so that the text appears at the bottom  (note that using 
divs with display: table-* also has the same bug as using straight tables).

I'm using version 9.0.3 on Ubuntu and Java 1.7

Original issue reported on code.google.com by j...@bullethq.com on 17 Dec 2013 at 11:40

Attachments:

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Debugging through the flying-saucer code, it looks like when getCSSFitToWidth() 
is called, the table cell that the image is in is 0x0 dimensions, so 
flying-saucer thinks that the image should be 0 width.  It think this is a bug, 
since the 'image' td is defined as 35%, and the overall table is defined as 
100% width.

Settings the image class to an absolute size (such as 100px) means that the 
image is displayed - it's only not working when a percentage width is used.  I 
need to be able to use percentages in my case, since the HTML I'm using will 
also be used to display in a web browser

Original comment by j...@bullethq.com on 17 Dec 2013 at 1:28