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

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

Issue 13896036: [CSSMQ] Implemented support for the scan media feature. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: another static_cast removed. Created 7 years, 7 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/MediaFeatureNames.h ('k') | Source/core/css/MediaQueryExp.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/MediaQueryEvaluator.cpp
diff --git a/Source/core/css/MediaQueryEvaluator.cpp b/Source/core/css/MediaQueryEvaluator.cpp
index d1aa3f74b23342f292cac7de4e29f9d4ac323a69..f124b9901f9d14c23b75f1675e9bca5eeb3c3605 100644
--- a/Source/core/css/MediaQueryEvaluator.cpp
+++ b/Source/core/css/MediaQueryEvaluator.cpp
@@ -67,14 +67,6 @@ typedef bool (*EvalFunc)(CSSValue*, RenderStyle*, Frame*, MediaFeaturePrefix);
typedef HashMap<AtomicStringImpl*, EvalFunc> FunctionMap;
static FunctionMap* gFunctionMap;
-/*
- * FIXME: following media features are not implemented: scan
- *
- * scan: The "scan" media feature describes the scanning process of
- * tv output devices. It's unknown how to retrieve this information from
- * the platform
- */
-
MediaQueryEvaluator::MediaQueryEvaluator(bool mediaFeatureResult)
: m_frame(0)
, m_style(0)
@@ -660,6 +652,25 @@ static bool pointerMediaFeatureEval(CSSValue* value, RenderStyle*, Frame* frame,
|| (pointer == MousePointer && id == CSSValueFine);
}
+static bool scanMediaFeatureEval(CSSValue* value, RenderStyle*, Frame* frame, MediaFeaturePrefix)
+{
+ // Scan only applies to tv media.
+ if (!equalIgnoringCase(frame->view()->mediaType(), "tv"))
+ return false;
+
+ if (!value)
+ return true;
+
+ if (!value->isPrimitiveValue())
+ return false;
+
+ // If a platform interface supplies progressive/interlace info for TVs in the
+ // future, it needs to be handled here. For now, assume a modern TV with
+ // progressive display.
+ const int id = toCSSPrimitiveValue(value)->getIdent();
+ return id == CSSValueProgressive;
+}
+
static void createFunctionMap()
{
// Create the table.
« no previous file with comments | « Source/core/css/MediaFeatureNames.h ('k') | Source/core/css/MediaQueryExp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698