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

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

Issue 653023002: ASSERTION FAILED: factor > 0 (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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
« no previous file with comments | « Source/core/css/parser/SizesAttributeParser.cpp ('k') | no next file » | 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 74e7d1350790183f293fd66801efb85ce4ee3ea6..fee6e641576207f15f1b2da1575ef1e0bd60f1f2 100644
--- a/Source/core/html/HTMLImageElement.cpp
+++ b/Source/core/html/HTMLImageElement.cpp
@@ -306,7 +306,8 @@ ImageCandidate HTMLImageElement::findBestFitImageFromPictureParent()
String sizes = source->fastGetAttribute(sizesAttr);
if (!sizes.isNull())
UseCounter::count(document(), UseCounter::Sizes);
- SizesAttributeParser parser = SizesAttributeParser(MediaValuesDynamic::create(document()), sizes);
+ bool hasLocalFrame = document().frame() ? true : false;
adamk 2014/10/14 22:43:07 To answer Ojan's question, this is exactly the rea
ojan 2014/10/14 22:46:09 I don't know the code here well enough to know wha
adamk 2014/10/14 22:48:22 Sounds like we should reparse when we switch docum
+ SizesAttributeParser parser = SizesAttributeParser(MediaValuesDynamic::create(document()), sizes, hasLocalFrame);
float effectiveSize = parser.length();
m_effectiveSizeViewportDependant = parser.viewportDependant();
ImageCandidate candidate = bestFitSourceForSrcsetAttribute(document().devicePixelRatio(), effectiveSize, source->fastGetAttribute(srcsetAttr));
@@ -640,7 +641,8 @@ void HTMLImageElement::selectSourceURL(ImageLoader::UpdateFromElementBehavior be
String sizes = fastGetAttribute(sizesAttr);
if (!sizes.isNull())
UseCounter::count(document(), UseCounter::Sizes);
- SizesAttributeParser parser = SizesAttributeParser(MediaValuesDynamic::create(document()), sizes);
+ bool hasLocalFrame = document().frame() ? true : false;
+ SizesAttributeParser parser = SizesAttributeParser(MediaValuesDynamic::create(document()), sizes, hasLocalFrame);
effectiveSize = parser.length();
m_effectiveSizeViewportDependant = parser.viewportDependant();
}
« no previous file with comments | « Source/core/css/parser/SizesAttributeParser.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698