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 23 matching lines...) Expand all Loading... |
34 #include "wtf/PassOwnPtr.h" | 34 #include "wtf/PassOwnPtr.h" |
35 #include "wtf/RefPtr.h" | 35 #include "wtf/RefPtr.h" |
36 #include "wtf/text/AtomicString.h" | 36 #include "wtf/text/AtomicString.h" |
37 | 37 |
38 namespace WebCore { | 38 namespace WebCore { |
39 class CSSParserValueList; | 39 class CSSParserValueList; |
40 | 40 |
41 class MediaQueryExp { | 41 class MediaQueryExp { |
42 WTF_MAKE_FAST_ALLOCATED; | 42 WTF_MAKE_FAST_ALLOCATED; |
43 public: | 43 public: |
44 static PassOwnPtr<MediaQueryExp> create(const AtomicString& mediaFeature, CS
SParserValueList* values); | 44 static PassOwnPtr<MediaQueryExp> create(const AtomicString& mediaFeature, CS
SParserValueList*); |
45 ~MediaQueryExp(); | 45 ~MediaQueryExp(); |
46 | 46 |
47 AtomicString mediaFeature() const { return m_mediaFeature; } | 47 AtomicString mediaFeature() const { return m_mediaFeature; } |
48 | 48 |
49 CSSValue* value() const { return m_value.get(); } | 49 CSSValue* value() const { return m_value.get(); } |
50 | 50 |
51 bool operator==(const MediaQueryExp& other) const | 51 bool operator==(const MediaQueryExp& other) const |
52 { | 52 { |
53 return (other.m_mediaFeature == m_mediaFeature) | 53 return (other.m_mediaFeature == m_mediaFeature) |
54 && ((!other.m_value && !m_value) | 54 && ((!other.m_value && !m_value) |
55 || (other.m_value && m_value && other.m_value->equals(*m_value))
); | 55 || (other.m_value && m_value && other.m_value->equals(*m_value))
); |
56 } | 56 } |
57 | 57 |
58 bool isValid() const { return m_isValid; } | |
59 | |
60 bool isViewportDependent() const; | 58 bool isViewportDependent() const; |
61 | 59 |
62 String serialize() const; | 60 String serialize() const; |
63 | 61 |
64 PassOwnPtr<MediaQueryExp> copy() const { return adoptPtr(new MediaQueryExp(*
this)); } | 62 PassOwnPtr<MediaQueryExp> copy() const { return adoptPtr(new MediaQueryExp(*
this)); } |
65 | 63 |
66 void reportMemoryUsage(MemoryObjectInfo*) const; | 64 void reportMemoryUsage(MemoryObjectInfo*) const; |
67 | 65 |
68 private: | 66 private: |
69 MediaQueryExp(const AtomicString& mediaFeature, CSSParserValueList* values); | 67 MediaQueryExp(const AtomicString& mediaFeature, PassRefPtr<CSSValue>); |
70 | 68 |
71 AtomicString m_mediaFeature; | 69 AtomicString m_mediaFeature; |
72 RefPtr<CSSValue> m_value; | 70 RefPtr<CSSValue> m_value; |
73 bool m_isValid; | |
74 }; | 71 }; |
75 | 72 |
76 } // namespace | 73 } // namespace |
77 | 74 |
78 #endif | 75 #endif |
OLD | NEW |