Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(60)

Unified Diff: third_party/WebKit/Source/core/html/forms/ImageInputType.cpp

Issue 1384973004: Forward assigning to style on HTMLElement, SVGElement and CSSStyleRule to style.cssText (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add expectation files Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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();

Powered by Google App Engine
This is Rietveld 408576698