Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * CSS Media Query Evaluator | 2 * CSS Media Query Evaluator |
| 3 * | 3 * |
| 4 * Copyright (C) 2006 Kimmo Kinnunen <kimmo.t.kinnunen@nokia.com>. | 4 * Copyright (C) 2006 Kimmo Kinnunen <kimmo.t.kinnunen@nokia.com>. |
| 5 * Copyright (C) 2013 Apple Inc. All rights reserved. | 5 * Copyright (C) 2013 Apple Inc. All rights reserved. |
| 6 * Copyright (C) 2013 Intel Corporation. All rights reserved. | 6 * Copyright (C) 2013 Intel Corporation. All rights reserved. |
| 7 * | 7 * |
| 8 * Redistribution and use in source and binary forms, with or without | 8 * Redistribution and use in source and binary forms, with or without |
| 9 * modification, are permitted provided that the following conditions | 9 * modification, are permitted provided that the following conditions |
| 10 * are met: | 10 * are met: |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 214 return numberValue(value, number) && compareValue(0, static_cast<int >(number), op); | 214 return numberValue(value, number) && compareValue(0, static_cast<int >(number), op); |
| 215 } | 215 } |
| 216 return false; | 216 return false; |
| 217 } | 217 } |
| 218 | 218 |
| 219 return colorMediaFeatureEval(value, op, mediaValues); | 219 return colorMediaFeatureEval(value, op, mediaValues); |
| 220 } | 220 } |
| 221 | 221 |
| 222 static bool displayModeMediaFeatureEval(const MediaQueryExpValue& value, MediaFe aturePrefix, const MediaValues& mediaValues) | 222 static bool displayModeMediaFeatureEval(const MediaQueryExpValue& value, MediaFe aturePrefix, const MediaValues& mediaValues) |
| 223 { | 223 { |
| 224 if (!value.isValid()) | |
|
Mikhail
2015/10/13 14:01:16
would be nice to have a short comment here explain
| |
| 225 return true; | |
| 226 | |
| 224 if (!value.isID) | 227 if (!value.isID) |
| 225 return true; | 228 return false; |
| 226 | 229 |
| 227 WebDisplayMode mode = mediaValues.displayMode(); | 230 WebDisplayMode mode = mediaValues.displayMode(); |
| 228 switch (value.id) { | 231 switch (value.id) { |
| 229 case CSSValueFullscreen: | 232 case CSSValueFullscreen: |
| 230 return mode == WebDisplayModeFullscreen; | 233 return mode == WebDisplayModeFullscreen; |
| 231 case CSSValueStandalone: | 234 case CSSValueStandalone: |
| 232 return mode == WebDisplayModeStandalone; | 235 return mode == WebDisplayModeStandalone; |
| 233 case CSSValueMinimalUi: | 236 case CSSValueMinimalUi: |
| 234 return mode == WebDisplayModeMinimalUi; | 237 return mode == WebDisplayModeMinimalUi; |
| 235 case CSSValueBrowser: | 238 case CSSValueBrowser: |
| (...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 654 // Call the media feature evaluation function. Assume no prefix and let | 657 // Call the media feature evaluation function. Assume no prefix and let |
| 655 // trampoline functions override the prefix if prefix is used. | 658 // trampoline functions override the prefix if prefix is used. |
| 656 EvalFunc func = gFunctionMap->get(expr->mediaFeature().impl()); | 659 EvalFunc func = gFunctionMap->get(expr->mediaFeature().impl()); |
| 657 if (func) | 660 if (func) |
| 658 return func(expr->expValue(), NoPrefix, *m_mediaValues); | 661 return func(expr->expValue(), NoPrefix, *m_mediaValues); |
| 659 | 662 |
| 660 return false; | 663 return false; |
| 661 } | 664 } |
| 662 | 665 |
| 663 } // namespace | 666 } // namespace |
| OLD | NEW |