| 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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 return a <= b; | 165 return a <= b; |
| 166 case NoPrefix: | 166 case NoPrefix: |
| 167 return a == b; | 167 return a == b; |
| 168 } | 168 } |
| 169 return false; | 169 return false; |
| 170 } | 170 } |
| 171 | 171 |
| 172 static bool compareAspectRatioValue(CSSValue* value, int width, int height, Medi
aFeaturePrefix op) | 172 static bool compareAspectRatioValue(CSSValue* value, int width, int height, Medi
aFeaturePrefix op) |
| 173 { | 173 { |
| 174 if (value->isAspectRatioValue()) { | 174 if (value->isAspectRatioValue()) { |
| 175 CSSAspectRatioValue* aspectRatio = static_cast<CSSAspectRatioValue*>(val
ue); | 175 CSSAspectRatioValue* aspectRatio = toCSSAspectRatioValue(value); |
| 176 return compareValue(width * static_cast<int>(aspectRatio->denominatorVal
ue()), height * static_cast<int>(aspectRatio->numeratorValue()), op); | 176 return compareValue(width * static_cast<int>(aspectRatio->denominatorVal
ue()), height * static_cast<int>(aspectRatio->numeratorValue()), op); |
| 177 } | 177 } |
| 178 | 178 |
| 179 return false; | 179 return false; |
| 180 } | 180 } |
| 181 | 181 |
| 182 static bool numberValue(CSSValue* value, float& result) | 182 static bool numberValue(CSSValue* value, float& result) |
| 183 { | 183 { |
| 184 if (value->isPrimitiveValue() | 184 if (value->isPrimitiveValue() |
| 185 && toCSSPrimitiveValue(value)->isNumber()) { | 185 && toCSSPrimitiveValue(value)->isNumber()) { |
| (...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 684 // and let trampoline functions override the prefix if prefix is | 684 // and let trampoline functions override the prefix if prefix is |
| 685 // used | 685 // used |
| 686 EvalFunc func = gFunctionMap->get(expr->mediaFeature().impl()); | 686 EvalFunc func = gFunctionMap->get(expr->mediaFeature().impl()); |
| 687 if (func) | 687 if (func) |
| 688 return func(expr->value(), m_style.get(), m_frame, NoPrefix); | 688 return func(expr->value(), m_style.get(), m_frame, NoPrefix); |
| 689 | 689 |
| 690 return false; | 690 return false; |
| 691 } | 691 } |
| 692 | 692 |
| 693 } // namespace | 693 } // namespace |
| OLD | NEW |