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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 struct MediaQueryExpValue { | 42 struct MediaQueryExpValue { |
43 CSSValueID id; | 43 CSSValueID id; |
44 double value; | 44 double value; |
45 CSSPrimitiveValue::UnitType unit; | 45 CSSPrimitiveValue::UnitType unit; |
46 unsigned numerator; | 46 unsigned numerator; |
47 unsigned denominator; | 47 unsigned denominator; |
48 | 48 |
49 bool isID; | 49 bool isID; |
50 bool isValue; | 50 bool isValue; |
51 bool isRatio; | 51 bool isRatio; |
52 bool isInteger; | |
53 | 52 |
54 MediaQueryExpValue() | 53 MediaQueryExpValue() |
55 : id(CSSValueInvalid) | 54 : id(CSSValueInvalid) |
56 , value(0) | 55 , value(0) |
57 , unit(CSSPrimitiveValue::CSS_UNKNOWN) | 56 , unit(CSSPrimitiveValue::CSS_UNKNOWN) |
58 , numerator(0) | 57 , numerator(0) |
59 , denominator(1) | 58 , denominator(1) |
60 , isID(false) | 59 , isID(false) |
61 , isValue(false) | 60 , isValue(false) |
62 , isRatio(false) | 61 , isRatio(false) |
63 , isInteger(false) | |
64 { | 62 { |
65 } | 63 } |
66 | 64 |
67 bool isValid() const { return (isID || isValue || isRatio); } | 65 bool isValid() const { return (isID || isValue || isRatio); } |
68 String cssText() const; | 66 String cssText() const; |
69 bool equals(const MediaQueryExpValue& expValue) const | 67 bool equals(const MediaQueryExpValue& expValue) const |
70 { | 68 { |
71 if (isID) | 69 if (isID) |
72 return (id == expValue.id); | 70 return (id == expValue.id); |
73 if (isValue) | 71 if (isValue) |
(...skipping 29 matching lines...) Expand all Loading... |
103 private: | 101 private: |
104 MediaQueryExp(const String&, const MediaQueryExpValue&); | 102 MediaQueryExp(const String&, const MediaQueryExpValue&); |
105 | 103 |
106 String m_mediaFeature; | 104 String m_mediaFeature; |
107 MediaQueryExpValue m_expValue; | 105 MediaQueryExpValue m_expValue; |
108 }; | 106 }; |
109 | 107 |
110 } // namespace | 108 } // namespace |
111 | 109 |
112 #endif | 110 #endif |
OLD | NEW |