Chromium Code Reviews| Index: java/org/chromium/distiller/extractors/embeds/ImageExtractor.java |
| diff --git a/java/org/chromium/distiller/extractors/embeds/ImageExtractor.java b/java/org/chromium/distiller/extractors/embeds/ImageExtractor.java |
| index a450ea9d23f276a71b664a0e78254dee7159fdeb..a03fbfc882c61d6ee5e1c409dd45499cd9da1242 100644 |
| --- a/java/org/chromium/distiller/extractors/embeds/ImageExtractor.java |
| +++ b/java/org/chromium/distiller/extractors/embeds/ImageExtractor.java |
| @@ -33,11 +33,17 @@ public class ImageExtractor implements EmbedExtractor { |
| return null; |
| } |
| String imgSrc = ""; |
| + int width = e.getOffsetWidth(); |
| + int height = e.getOffsetHeight(); |
|
wychen
2016/03/11 08:25:35
offsetWidth/Height would be affected by padding, b
dalmirsilva
2016/03/14 18:28:06
Done.
|
| if ("IMG".equals(e.getTagName())) { |
| - // This will get the absolute URL of the image. |
| - imgSrc = ImageElement.as(e).getSrc(); |
| + // This will get the absolute URL of the image and |
| + // the real image dimension. |
| + ImageElement imageElement = ImageElement.as(e); |
| + imgSrc = imageElement.getSrc(); |
| + width = imageElement.getWidth(); |
|
wychen
2016/03/11 08:25:35
What if the dimension specified in CSS is differen
wychen
2016/03/11 08:25:35
If only width or height is specified, the other on
dalmirsilva
2016/03/14 18:28:05
We believe GWT uses getWidth/Height as native meth
|
| + height = imageElement.getHeight(); |
| } |
| - return new WebImage(e, e.getOffsetWidth(), e.getOffsetHeight(), imgSrc); |
| + return new WebImage(e, width, height, imgSrc); |
| } |
| } |