radkovo / CSSBox

CSSBox is an (X)HTML/CSS rendering engine written in pure Java. Its primary purpose is to provide a complete information about the rendered page suitable for further processing. However, it also allows displaying the rendered document.
http://cssbox.sourceforge.net/
GNU Lesser General Public License v3.0
234 stars 76 forks source link

DOMAnalyzer.attributesToStyles not handling width and height on img #52

Closed Meisolsson closed 5 years ago

Meisolsson commented 5 years ago

width and height are not being read from the img tag.

radkovo commented 5 years ago

It's because their conversion to CSS is not straightforward; e.g. when the attributes are combined with an inline style definition containing percentages. Decoding of width and height is implemented separately in CSSDecoder#computeReplacedObjectSize.