Chromium Code Reviews| Index: third_party/WebKit/Source/core/html/forms/ImageInputType.cpp |
| diff --git a/third_party/WebKit/Source/core/html/forms/ImageInputType.cpp b/third_party/WebKit/Source/core/html/forms/ImageInputType.cpp |
| index f7dc76e5507b1d587f5ecfa6f3871c83777a837a..7a456cdaac956ba8be0f72c288f9a37c9e1970a3 100644 |
| --- a/third_party/WebKit/Source/core/html/forms/ImageInputType.cpp |
| +++ b/third_party/WebKit/Source/core/html/forms/ImageInputType.cpp |
| @@ -197,17 +197,15 @@ unsigned ImageInputType::height() const |
| { |
| RefPtrWillBeRawPtr<HTMLInputElement> element(this->element()); |
| - if (!element->layoutObject()) { |
|
rune
2015/10/06 08:19:53
The changes in this file look unrelated to me.
nainar
2015/10/06 23:52:52
This statement checks to see if element->layoutObj
Timothy Loh
2015/10/07 00:03:01
What tests?
|
| - // Check the attribute first for an explicit pixel value. |
| - unsigned height; |
| - if (parseHTMLNonNegativeInteger(element->fastGetAttribute(heightAttr), height)) |
| - return height; |
| - |
| - // If the image is available, use its height. |
| - HTMLImageLoader* imageLoader = element->imageLoader(); |
| - if (imageLoader && imageLoader->image()) |
| - return imageLoader->image()->imageSizeForLayoutObject(element->layoutObject(), 1).height(); |
| - } |
| + // Check the attribute first for an explicit pixel value. |
| + unsigned height; |
| + if (parseHTMLNonNegativeInteger(element->fastGetAttribute(heightAttr), height)) |
| + return height; |
| + |
| + // If the image is available, use its height. |
| + HTMLImageLoader* imageLoader = element->imageLoader(); |
| + if (element->layoutObject() && imageLoader && imageLoader->image()) |
| + return imageLoader->image()->imageSizeForLayoutObject(element->layoutObject(), 1).height(); |
| element->document().updateLayout(); |
| @@ -219,17 +217,15 @@ unsigned ImageInputType::width() const |
| { |
| RefPtrWillBeRawPtr<HTMLInputElement> element(this->element()); |
| - if (!element->layoutObject()) { |
| // Check the attribute first for an explicit pixel value. |
| - unsigned width; |
| - if (parseHTMLNonNegativeInteger(element->fastGetAttribute(widthAttr), width)) |
| - return width; |
| - |
| - // If the image is available, use its width. |
| - HTMLImageLoader* imageLoader = element->imageLoader(); |
| - if (imageLoader && imageLoader->image()) |
| - return imageLoader->image()->imageSizeForLayoutObject(element->layoutObject(), 1).width(); |
| - } |
| + unsigned width; |
| + if (parseHTMLNonNegativeInteger(element->fastGetAttribute(widthAttr), width)) |
| + return width; |
| + |
| + // If the image is available, use its width. |
| + HTMLImageLoader* imageLoader = element->imageLoader(); |
| + if (element->layoutObject() && imageLoader && imageLoader->image()) |
| + return imageLoader->image()->imageSizeForLayoutObject(element->layoutObject(), 1).width(); |
| element->document().updateLayout(); |