OLD | NEW |
1 /* | 1 /* |
2 * CSS Media Query | 2 * CSS Media Query |
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) 2010 Nokia Corporation and/or its subsidiary(-ies). | 5 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
6 * | 6 * |
7 * Redistribution and use in source and binary forms, with or without | 7 * Redistribution and use in source and binary forms, with or without |
8 * modification, are permitted provided that the following conditions | 8 * modification, are permitted provided that the following conditions |
9 * are met: | 9 * are met: |
10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 if (isValue) | 75 if (isValue) |
76 return (value == expValue.value); | 76 return (value == expValue.value); |
77 if (isRatio) | 77 if (isRatio) |
78 return (numerator == expValue.numerator && denominator == expValue.d
enominator); | 78 return (numerator == expValue.numerator && denominator == expValue.d
enominator); |
79 return !expValue.isValid(); | 79 return !expValue.isValid(); |
80 } | 80 } |
81 }; | 81 }; |
82 | 82 |
83 class CORE_EXPORT MediaQueryExp : public GarbageCollectedFinalized<MediaQueryEx
p> { | 83 class CORE_EXPORT MediaQueryExp : public GarbageCollectedFinalized<MediaQueryEx
p> { |
84 public: | 84 public: |
85 static RawPtr<MediaQueryExp> createIfValid(const String& mediaFeature, const
Vector<CSSParserToken, 4>&); | 85 static MediaQueryExp* createIfValid(const String& mediaFeature, const Vector
<CSSParserToken, 4>&); |
86 ~MediaQueryExp(); | 86 ~MediaQueryExp(); |
87 | 87 |
88 const String& mediaFeature() const { return m_mediaFeature; } | 88 const String& mediaFeature() const { return m_mediaFeature; } |
89 | 89 |
90 MediaQueryExpValue expValue() const { return m_expValue; } | 90 MediaQueryExpValue expValue() const { return m_expValue; } |
91 | 91 |
92 bool operator==(const MediaQueryExp& other) const; | 92 bool operator==(const MediaQueryExp& other) const; |
93 | 93 |
94 bool isViewportDependent() const; | 94 bool isViewportDependent() const; |
95 | 95 |
96 bool isDeviceDependent() const; | 96 bool isDeviceDependent() const; |
97 | 97 |
98 String serialize() const; | 98 String serialize() const; |
99 | 99 |
100 RawPtr<MediaQueryExp> copy() const { return new MediaQueryExp(*this); } | 100 MediaQueryExp* copy() const { return new MediaQueryExp(*this); } |
101 | 101 |
102 MediaQueryExp(const MediaQueryExp& other); | 102 MediaQueryExp(const MediaQueryExp& other); |
103 | 103 |
104 DEFINE_INLINE_TRACE() { } | 104 DEFINE_INLINE_TRACE() { } |
105 | 105 |
106 private: | 106 private: |
107 MediaQueryExp(const String&, const MediaQueryExpValue&); | 107 MediaQueryExp(const String&, const MediaQueryExpValue&); |
108 | 108 |
109 String m_mediaFeature; | 109 String m_mediaFeature; |
110 MediaQueryExpValue m_expValue; | 110 MediaQueryExpValue m_expValue; |
111 }; | 111 }; |
112 | 112 |
113 } // namespace blink | 113 } // namespace blink |
114 | 114 |
115 #endif | 115 #endif |
OLD | NEW |