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

Unified Diff: Source/core/css/MediaQueryList.cpp

Issue 369423002: Have srcset respond to viewport changes (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: review comments Created 6 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
Index: Source/core/css/MediaQueryList.cpp
diff --git a/Source/core/css/MediaQueryList.cpp b/Source/core/css/MediaQueryList.cpp
index 70943e0a5c10d6f506881ca65ea02b4eac5b4325..b02f6d4093c873d9d977f4e64b36a909182eba98 100644
--- a/Source/core/css/MediaQueryList.cpp
+++ b/Source/core/css/MediaQueryList.cpp
@@ -37,6 +37,7 @@ MediaQueryList::MediaQueryList(PassRefPtrWillBeRawPtr<MediaQueryMatcher> matcher
, m_media(media)
, m_matchesDirty(true)
, m_matches(false)
+ , m_alwaysUpdate(false)
{
m_matcher->addMediaQueryList(this);
updateMatches();
@@ -99,7 +100,7 @@ void MediaQueryList::mediaFeaturesChanged(WillBeHeapVector<RefPtrWillBeMember<Me
bool MediaQueryList::updateMatches()
{
m_matchesDirty = false;
- if (m_matches != m_matcher->evaluate(m_media.get())) {
+ if (m_alwaysUpdate || m_matches != m_matcher->evaluate(m_media.get())) {
m_matches = !m_matches;
return true;
}

Powered by Google App Engine
This is Rietveld 408576698