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 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); | 343 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); |
344 | 344 |
345 if (primitiveValue->isNumber()) { | 345 if (primitiveValue->isNumber()) { |
346 result = primitiveValue->getIntValue(); | 346 result = primitiveValue->getIntValue(); |
347 return !strict || !result; | 347 return !strict || !result; |
348 } | 348 } |
349 | 349 |
350 if (primitiveValue->isLength()) { | 350 if (primitiveValue->isLength()) { |
351 // Relative (like EM) and root relative (like REM) units are always reso
lved against | 351 // Relative (like EM) and root relative (like REM) units are always reso
lved against |
352 // the initial values for media queries, hence the two initialStyle para
meters. | 352 // the initial values for media queries, hence the two initialStyle para
meters. |
353 result = primitiveValue->computeLength<int>(CSSToLengthConversionData(in
itialStyle, initialStyle, 1.0 /* zoom */, true /* computingFontSize */)); | 353 // FIXME: We need to plumb viewport unit support down to here. |
| 354 result = primitiveValue->computeLength<int>(CSSToLengthConversionData(in
itialStyle, initialStyle, 0, 1.0 /* zoom */, true /* computingFontSize */)); |
354 return true; | 355 return true; |
355 } | 356 } |
356 | 357 |
357 return false; | 358 return false; |
358 } | 359 } |
359 | 360 |
360 static bool deviceHeightMediaFeatureEval(CSSValue* value, RenderStyle* style, Fr
ame* frame, MediaFeaturePrefix op) | 361 static bool deviceHeightMediaFeatureEval(CSSValue* value, RenderStyle* style, Fr
ame* frame, MediaFeaturePrefix op) |
361 { | 362 { |
362 if (value) { | 363 if (value) { |
363 int length; | 364 int length; |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
686 // Call the media feature evaluation function. Assume no prefix and let | 687 // Call the media feature evaluation function. Assume no prefix and let |
687 // trampoline functions override the prefix if prefix is used. | 688 // trampoline functions override the prefix if prefix is used. |
688 EvalFunc func = gFunctionMap->get(expr->mediaFeature().impl()); | 689 EvalFunc func = gFunctionMap->get(expr->mediaFeature().impl()); |
689 if (func) | 690 if (func) |
690 return func(expr->value(), m_style.get(), m_frame, NoPrefix); | 691 return func(expr->value(), m_style.get(), m_frame, NoPrefix); |
691 | 692 |
692 return false; | 693 return false; |
693 } | 694 } |
694 | 695 |
695 } // namespace | 696 } // namespace |
OLD | NEW |