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

Unified Diff: third_party/WebKit/Source/core/css/MediaQueryEvaluator.cpp

Issue 1395543005: matchMedia('(display-mode: <notValid>)').matches should not evaluate true (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add comments Created 5 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
Index: third_party/WebKit/Source/core/css/MediaQueryEvaluator.cpp
diff --git a/third_party/WebKit/Source/core/css/MediaQueryEvaluator.cpp b/third_party/WebKit/Source/core/css/MediaQueryEvaluator.cpp
index b845244f5ca3f925222dc2e54b354052935fe612..d9a6db185134bde850ef0deb1d3d2e36bd580670 100644
--- a/third_party/WebKit/Source/core/css/MediaQueryEvaluator.cpp
+++ b/third_party/WebKit/Source/core/css/MediaQueryEvaluator.cpp
@@ -221,9 +221,14 @@ static bool monochromeMediaFeatureEval(const MediaQueryExpValue& value, MediaFea
static bool displayModeMediaFeatureEval(const MediaQueryExpValue& value, MediaFeaturePrefix, const MediaValues& mediaValues)
{
- if (!value.isID)
+ // isValid() is false if there is no parameter. Without parameter we should return true to indicate that
+ // displayModeMediaFeature is enabled in the browser.
+ if (!value.isValid())
return true;
+ if (!value.isID)
+ return false;
+
WebDisplayMode mode = mediaValues.displayMode();
switch (value.id) {
case CSSValueFullscreen:

Powered by Google App Engine
This is Rietveld 408576698