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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 #include "core/rendering/style/RenderStyle.h" | 51 #include "core/rendering/style/RenderStyle.h" |
52 #include "wtf/HashMap.h" | 52 #include "wtf/HashMap.h" |
53 | 53 |
54 namespace WebCore { | 54 namespace WebCore { |
55 | 55 |
56 using namespace MediaFeatureNames; | 56 using namespace MediaFeatureNames; |
57 | 57 |
58 enum MediaFeaturePrefix { MinPrefix, MaxPrefix, NoPrefix }; | 58 enum MediaFeaturePrefix { MinPrefix, MaxPrefix, NoPrefix }; |
59 | 59 |
60 typedef bool (*EvalFunc)(CSSValue*, RenderStyle*, Frame*, MediaFeaturePrefix); | 60 typedef bool (*EvalFunc)(CSSValue*, RenderStyle*, Frame*, MediaFeaturePrefix); |
61 typedef HashMap<AtomicStringImpl*, EvalFunc> FunctionMap; | 61 typedef HashMap<StringImpl*, EvalFunc> FunctionMap; |
62 static FunctionMap* gFunctionMap; | 62 static FunctionMap* gFunctionMap; |
63 | 63 |
64 MediaQueryEvaluator::MediaQueryEvaluator(bool mediaFeatureResult) | 64 MediaQueryEvaluator::MediaQueryEvaluator(bool mediaFeatureResult) |
65 : m_frame(0) | 65 : m_frame(0) |
66 , m_style(0) | 66 , m_style(0) |
67 , m_expResult(mediaFeatureResult) | 67 , m_expResult(mediaFeatureResult) |
68 { | 68 { |
69 } | 69 } |
70 | 70 |
71 MediaQueryEvaluator::MediaQueryEvaluator(const AtomicString& acceptedMediaType,
bool mediaFeatureResult) | 71 MediaQueryEvaluator::MediaQueryEvaluator(const AtomicString& acceptedMediaType,
bool mediaFeatureResult) |
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
688 // and let trampoline functions override the prefix if prefix is | 688 // and let trampoline functions override the prefix if prefix is |
689 // used | 689 // used |
690 EvalFunc func = gFunctionMap->get(expr->mediaFeature().impl()); | 690 EvalFunc func = gFunctionMap->get(expr->mediaFeature().impl()); |
691 if (func) | 691 if (func) |
692 return func(expr->value(), m_style.get(), m_frame, NoPrefix); | 692 return func(expr->value(), m_style.get(), m_frame, NoPrefix); |
693 | 693 |
694 return false; | 694 return false; |
695 } | 695 } |
696 | 696 |
697 } // namespace | 697 } // namespace |
OLD | NEW |