Chromium Code Reviews| 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. |