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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 return bitsPerComponent != 0; | 194 return bitsPerComponent != 0; |
195 } | 195 } |
196 | 196 |
197 static bool colorIndexMediaFeatureEval(const MediaQueryExpValue& value, MediaFea
turePrefix op, const MediaValues&) | 197 static bool colorIndexMediaFeatureEval(const MediaQueryExpValue& value, MediaFea
turePrefix op, const MediaValues&) |
198 { | 198 { |
199 // FIXME: We currently assume that we do not support indexed displays, as it
is unknown | 199 // FIXME: We currently assume that we do not support indexed displays, as it
is unknown |
200 // how to retrieve the information if the display mode is indexed. This matc
hes Firefox. | 200 // how to retrieve the information if the display mode is indexed. This matc
hes Firefox. |
201 if (!value.isValid()) | 201 if (!value.isValid()) |
202 return false; | 202 return false; |
203 | 203 |
204 // Acording to spec, if the device does not use a color lookup table, the va
lue is zero. | 204 // According to spec, if the device does not use a color lookup table, the v
alue is zero. |
205 float number; | 205 float number; |
206 return numberValue(value, number) && compareValue(0, static_cast<int>(number
), op); | 206 return numberValue(value, number) && compareValue(0, static_cast<int>(number
), op); |
207 } | 207 } |
208 | 208 |
209 static bool monochromeMediaFeatureEval(const MediaQueryExpValue& value, MediaFea
turePrefix op, const MediaValues& mediaValues) | 209 static bool monochromeMediaFeatureEval(const MediaQueryExpValue& value, MediaFea
turePrefix op, const MediaValues& mediaValues) |
210 { | 210 { |
211 if (!mediaValues.monochromeBitsPerComponent()) { | 211 if (!mediaValues.monochromeBitsPerComponent()) { |
212 if (value.isValid()) { | 212 if (value.isValid()) { |
213 float number; | 213 float number; |
214 return numberValue(value, number) && compareValue(0, static_cast<int
>(number), op); | 214 return numberValue(value, number) && compareValue(0, static_cast<int
>(number), op); |
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
659 // Call the media feature evaluation function. Assume no prefix and let | 659 // Call the media feature evaluation function. Assume no prefix and let |
660 // trampoline functions override the prefix if prefix is used. | 660 // trampoline functions override the prefix if prefix is used. |
661 EvalFunc func = gFunctionMap->get(expr->mediaFeature().impl()); | 661 EvalFunc func = gFunctionMap->get(expr->mediaFeature().impl()); |
662 if (func) | 662 if (func) |
663 return func(expr->expValue(), NoPrefix, *m_mediaValues); | 663 return func(expr->expValue(), NoPrefix, *m_mediaValues); |
664 | 664 |
665 return false; | 665 return false; |
666 } | 666 } |
667 | 667 |
668 } // namespace | 668 } // namespace |
OLD | NEW |