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

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: Created 7 years, 8 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 3a223ea5ae2c8a8eb8e59003c4f3fcd80f813c74..d7e0fa8dc926552e04d78ecefc25e41c3ac49bfa 100644
--- a/Source/core/css/MediaQueryEvaluator.cpp
+++ b/Source/core/css/MediaQueryEvaluator.cpp
@@ -66,13 +66,10 @@ typedef HashMap<AtomicStringImpl*, EvalFunc> FunctionMap;
static FunctionMap* gFunctionMap;
/*
- * FIXME: following media features are not implemented: color_index, scan
+ * FIXME: following media features are not implemented: color_index
*
* color_index, min-color-index, max_color_index: It's unknown how to retrieve
* the information if the display mode is indexed
- * 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)
@@ -744,6 +741,29 @@ static bool pointerMediaFeatureEval(CSSValue* value, RenderStyle*, Frame* frame,
|| (pointer == MousePointer && id == CSSValueFine);
}
+static bool scanMediaFeatureEval(CSSValue* value, RenderStyle*, Frame* frame, MediaFeaturePrefix)
+{
+ String mediaType = frame->view()->mediaType();
+
+ // scan only applies to tv media.
apavlov 2013/05/15 11:29:41 Blink mostly inherits the comment style from WebKi
+ if (equalIgnoringCase(mediaType, "tv")) {
apavlov 2013/05/15 11:29:41 Early returns are preferred, as they reduce code i
+
apavlov 2013/05/15 11:29:41 extra blank line
+ if (!value)
+ return true;
+
+ if (!value->isPrimitiveValue())
+ return false;
+
+ // If a platform interface supply progressive/interlace info for TVs in the
apavlov 2013/05/15 11:29:41 supply -> supplies
+ // future, it needs to be handled here. For now, assume a modern TV with
+ // progressive display.
+ const int id = static_cast<CSSPrimitiveValue*>(value)->getIdent();
+ return id == CSSValueProgressive;
+ }
+
+ return false;
+}
+
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