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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 switch (value.id) { | 262 switch (value.id) { |
263 case CSSValueFullscreen: | 263 case CSSValueFullscreen: |
264 return mode == WebDisplayModeFullscreen; | 264 return mode == WebDisplayModeFullscreen; |
265 case CSSValueStandalone: | 265 case CSSValueStandalone: |
266 return mode == WebDisplayModeStandalone; | 266 return mode == WebDisplayModeStandalone; |
267 case CSSValueMinimalUi: | 267 case CSSValueMinimalUi: |
268 return mode == WebDisplayModeMinimalUi; | 268 return mode == WebDisplayModeMinimalUi; |
269 case CSSValueBrowser: | 269 case CSSValueBrowser: |
270 return mode == WebDisplayModeBrowser; | 270 return mode == WebDisplayModeBrowser; |
271 default: | 271 default: |
272 ASSERT_NOT_REACHED(); | 272 NOTREACHED(); |
273 return false; | 273 return false; |
274 } | 274 } |
275 } | 275 } |
276 | 276 |
277 static bool orientationMediaFeatureEval(const MediaQueryExpValue& value, | 277 static bool orientationMediaFeatureEval(const MediaQueryExpValue& value, |
278 MediaFeaturePrefix, | 278 MediaFeaturePrefix, |
279 const MediaValues& mediaValues) { | 279 const MediaValues& mediaValues) { |
280 int width = mediaValues.viewportWidth(); | 280 int width = mediaValues.viewportWidth(); |
281 int height = mediaValues.viewportHeight(); | 281 int height = mediaValues.viewportHeight(); |
282 | 282 |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
657 | 657 |
658 if (!value.isID) | 658 if (!value.isID) |
659 return false; | 659 return false; |
660 | 660 |
661 switch (value.id) { | 661 switch (value.id) { |
662 case CSSValueNone: | 662 case CSSValueNone: |
663 return availableHoverTypes & HoverTypeNone; | 663 return availableHoverTypes & HoverTypeNone; |
664 case CSSValueHover: | 664 case CSSValueHover: |
665 return availableHoverTypes & HoverTypeHover; | 665 return availableHoverTypes & HoverTypeHover; |
666 default: | 666 default: |
667 ASSERT_NOT_REACHED(); | 667 NOTREACHED(); |
668 return false; | 668 return false; |
669 } | 669 } |
670 } | 670 } |
671 | 671 |
672 static bool pointerMediaFeatureEval(const MediaQueryExpValue& value, | 672 static bool pointerMediaFeatureEval(const MediaQueryExpValue& value, |
673 MediaFeaturePrefix, | 673 MediaFeaturePrefix, |
674 const MediaValues& mediaValues) { | 674 const MediaValues& mediaValues) { |
675 PointerType pointer = mediaValues.primaryPointerType(); | 675 PointerType pointer = mediaValues.primaryPointerType(); |
676 | 676 |
677 if (!value.isValid()) | 677 if (!value.isValid()) |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
719 return false; | 719 return false; |
720 | 720 |
721 switch (value.id) { | 721 switch (value.id) { |
722 case CSSValueCoarse: | 722 case CSSValueCoarse: |
723 return availablePointers & PointerTypeCoarse; | 723 return availablePointers & PointerTypeCoarse; |
724 case CSSValueFine: | 724 case CSSValueFine: |
725 return availablePointers & PointerTypeFine; | 725 return availablePointers & PointerTypeFine; |
726 case CSSValueNone: | 726 case CSSValueNone: |
727 return availablePointers & PointerTypeNone; | 727 return availablePointers & PointerTypeNone; |
728 default: | 728 default: |
729 ASSERT_NOT_REACHED(); | 729 NOTREACHED(); |
730 return false; | 730 return false; |
731 } | 731 } |
732 } | 732 } |
733 | 733 |
734 static bool scanMediaFeatureEval(const MediaQueryExpValue& value, | 734 static bool scanMediaFeatureEval(const MediaQueryExpValue& value, |
735 MediaFeaturePrefix, | 735 MediaFeaturePrefix, |
736 const MediaValues& mediaValues) { | 736 const MediaValues& mediaValues) { |
737 // Scan only applies to 'tv' media. | 737 // Scan only applies to 'tv' media. |
738 if (!equalIgnoringCase(mediaValues.mediaType(), MediaTypeNames::tv)) | 738 if (!equalIgnoringCase(mediaValues.mediaType(), MediaTypeNames::tv)) |
739 return false; | 739 return false; |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
810 // Call the media feature evaluation function. Assume no prefix and let | 810 // Call the media feature evaluation function. Assume no prefix and let |
811 // trampoline functions override the prefix if prefix is used. | 811 // trampoline functions override the prefix if prefix is used. |
812 EvalFunc func = gFunctionMap->at(expr->mediaFeature().impl()); | 812 EvalFunc func = gFunctionMap->at(expr->mediaFeature().impl()); |
813 if (func) | 813 if (func) |
814 return func(expr->expValue(), NoPrefix, *m_mediaValues); | 814 return func(expr->expValue(), NoPrefix, *m_mediaValues); |
815 | 815 |
816 return false; | 816 return false; |
817 } | 817 } |
818 | 818 |
819 } // namespace blink | 819 } // namespace blink |
OLD | NEW |