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

Unified Diff: Source/core/html/HTMLImageElement.cpp

Issue 1218413002: Remove width calculation in `Width` hint (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Removed widthAttr support in `Width` hint Created 5 years, 5 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
« no previous file with comments | « Source/core/html/HTMLImageElement.h ('k') | Source/core/html/HTMLImageElementTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLImageElement.cpp
diff --git a/Source/core/html/HTMLImageElement.cpp b/Source/core/html/HTMLImageElement.cpp
index ba5232f78d07c2f5b96c536c3ca0f6edbbb28c83..8d764b0befcf29de49b06e10af8355165fb98be1 100644
--- a/Source/core/html/HTMLImageElement.cpp
+++ b/Source/core/html/HTMLImageElement.cpp
@@ -641,25 +641,10 @@ static bool sourceSizeValue(Element& element, Document& currentDocument, float&
return exists;
}
-int HTMLImageElement::widthAttributeToInt(const String& value, bool& isValid)
-{
- // '%' is excluded here since having a width percentage based value means
- // that the actual width depends on layout, so we cannot use it for resourceWidth.
- // '*' is exclueded since in Blink and WebKit it means that the entire attribtue is ignored.
- // TODO(yoav): Count these occurences and try to deprecate/remove if feasible: crbug.com/501870
- if (!value.isEmpty() && !value.contains('%') && !value.contains('*'))
- return value.toInt(&isValid);
-
- isValid = false;
- return 0;
-}
-
FetchRequest::ResourceWidth HTMLImageElement::resourceWidth()
{
FetchRequest::ResourceWidth resourceWidth;
resourceWidth.isSet = sourceSizeValue(*this, document(), resourceWidth.width);
- if (!resourceWidth.isSet)
- resourceWidth.width = widthAttributeToInt(fastGetAttribute(widthAttr), resourceWidth.isSet);
return resourceWidth;
}
« no previous file with comments | « Source/core/html/HTMLImageElement.h ('k') | Source/core/html/HTMLImageElementTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698