Chromium Code Reviews| 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(); |
| } |