| 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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 return nullAtom; | 108 return nullAtom; |
| 109 } | 109 } |
| 110 | 110 |
| 111 bool MediaQueryEvaluator::mediaTypeMatch(const String& mediaTypeToMatch) const | 111 bool MediaQueryEvaluator::mediaTypeMatch(const String& mediaTypeToMatch) const |
| 112 { | 112 { |
| 113 return mediaTypeToMatch.isEmpty() | 113 return mediaTypeToMatch.isEmpty() |
| 114 || equalIgnoringCase(mediaTypeToMatch, MediaTypeNames::all) | 114 || equalIgnoringCase(mediaTypeToMatch, MediaTypeNames::all) |
| 115 || equalIgnoringCase(mediaTypeToMatch, mediaType()); | 115 || equalIgnoringCase(mediaTypeToMatch, mediaType()); |
| 116 } | 116 } |
| 117 | 117 |
| 118 static bool applyRestrictor(MediaQuery::Restrictor r, bool value) | 118 static bool applyRestrictor(MediaQuery::RestrictorType r, bool value) |
| 119 { | 119 { |
| 120 return r == MediaQuery::Not ? !value : value; | 120 return r == MediaQuery::Not ? !value : value; |
| 121 } | 121 } |
| 122 | 122 |
| 123 bool MediaQueryEvaluator::eval(const MediaQuery* query, MediaQueryResultList* vi
ewportDependentMediaQueryResults, MediaQueryResultList* deviceDependentMediaQuer
yResults) const | 123 bool MediaQueryEvaluator::eval(const MediaQuery* query, MediaQueryResultList* vi
ewportDependentMediaQueryResults, MediaQueryResultList* deviceDependentMediaQuer
yResults) const |
| 124 { | 124 { |
| 125 if (!mediaTypeMatch(query->mediaType())) | 125 if (!mediaTypeMatch(query->mediaType())) |
| 126 return applyRestrictor(query->restrictor(), false); | 126 return applyRestrictor(query->restrictor(), false); |
| 127 | 127 |
| 128 const ExpressionHeapVector& expressions = query->expressions(); | 128 const ExpressionHeapVector& expressions = query->expressions(); |
| (...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 665 // Call the media feature evaluation function. Assume no prefix and let | 665 // Call the media feature evaluation function. Assume no prefix and let |
| 666 // trampoline functions override the prefix if prefix is used. | 666 // trampoline functions override the prefix if prefix is used. |
| 667 EvalFunc func = gFunctionMap->get(expr->mediaFeature().impl()); | 667 EvalFunc func = gFunctionMap->get(expr->mediaFeature().impl()); |
| 668 if (func) | 668 if (func) |
| 669 return func(expr->expValue(), NoPrefix, *m_mediaValues); | 669 return func(expr->expValue(), NoPrefix, *m_mediaValues); |
| 670 | 670 |
| 671 return false; | 671 return false; |
| 672 } | 672 } |
| 673 | 673 |
| 674 } // namespace blink | 674 } // namespace blink |
| OLD | NEW |