Index: third_party/WebKit/Source/core/html/HTMLImageElement.cpp |
diff --git a/third_party/WebKit/Source/core/html/HTMLImageElement.cpp b/third_party/WebKit/Source/core/html/HTMLImageElement.cpp |
index f08e63e1b00be59083f3051fba30d7db24fdc307..3ad649bfd29fec336a2761c99d88a11539c64eb8 100644 |
--- a/third_party/WebKit/Source/core/html/HTMLImageElement.cpp |
+++ b/third_party/WebKit/Source/core/html/HTMLImageElement.cpp |
@@ -451,10 +451,7 @@ unsigned HTMLImageElement::width() { |
} |
} |
- LayoutBox* box = layoutBox(); |
- return box ? adjustForAbsoluteZoom(box->contentBoxRect().pixelSnappedWidth(), |
- box) |
- : 0; |
+ return layoutBoxWidth(); |
} |
unsigned HTMLImageElement::height() { |
@@ -478,10 +475,7 @@ unsigned HTMLImageElement::height() { |
} |
} |
- LayoutBox* box = layoutBox(); |
- return box ? adjustForAbsoluteZoom(box->contentBoxRect().pixelSnappedHeight(), |
- box) |
- : 0; |
+ return layoutBoxHeight(); |
} |
unsigned HTMLImageElement::naturalWidth() const { |
@@ -510,6 +504,20 @@ unsigned HTMLImageElement::naturalHeight() const { |
.toUnsigned(); |
} |
+unsigned HTMLImageElement::layoutBoxWidth() const { |
+ LayoutBox* box = layoutBox(); |
+ return box ? adjustForAbsoluteZoom(box->contentBoxRect().pixelSnappedWidth(), |
+ box) |
+ : 0; |
+} |
+ |
+unsigned HTMLImageElement::layoutBoxHeight() const { |
+ LayoutBox* box = layoutBox(); |
+ return box ? adjustForAbsoluteZoom(box->contentBoxRect().pixelSnappedHeight(), |
+ box) |
+ : 0; |
+} |
+ |
const String& HTMLImageElement::currentSrc() const { |
// http://www.whatwg.org/specs/web-apps/current-work/multipage/edits.html#dom-img-currentsrc |
// The currentSrc IDL attribute must return the img element's current |