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

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

Issue 287163010: Notify <picture> elements when a media query (potentially) changes (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: review comments Created 6 years, 6 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: Source/core/html/HTMLImageElement.cpp
diff --git a/Source/core/html/HTMLImageElement.cpp b/Source/core/html/HTMLImageElement.cpp
index f295f15850d1ad8127b732b53c4eab80fb8bc8b7..42284dad9ce7057d9197d4d93ed4e9993bcca952 100644
--- a/Source/core/html/HTMLImageElement.cpp
+++ b/Source/core/html/HTMLImageElement.cpp
@@ -243,12 +243,8 @@ ImageCandidate HTMLImageElement::findBestFitImageFromPictureParent()
if (!type.isEmpty() && !supportedImageType(type))
continue;
- String media = source->fastGetAttribute(mediaAttr);
- if (!media.isEmpty()) {
- RefPtrWillBeRawPtr<MediaQuerySet> mediaQueries = MediaQuerySet::create(media);
- if (!document().mediaQueryMatcher().evaluate(mediaQueries.get()))
- continue;
- }
+ if (!source->mediaQueryMatches())
+ continue;
unsigned effectiveSize = SizesAttributeParser::findEffectiveSize(source->fastGetAttribute(sizesAttr), MediaValuesDynamic::create(document()));
ImageCandidate candidate = bestFitSourceForSrcsetAttribute(document().devicePixelRatio(), effectiveSize, source->fastGetAttribute(srcsetAttr));

Powered by Google App Engine
This is Rietveld 408576698