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 29 matching lines...) Expand all Loading... |
40 | 40 |
41 typedef WillBeHeapVector<OwnPtrWillBeMember<MediaQueryExp> > ExpressionHeapVecto
r; | 41 typedef WillBeHeapVector<OwnPtrWillBeMember<MediaQueryExp> > ExpressionHeapVecto
r; |
42 | 42 |
43 class MediaQuery : public NoBaseWillBeGarbageCollectedFinalized<MediaQuery> { | 43 class MediaQuery : public NoBaseWillBeGarbageCollectedFinalized<MediaQuery> { |
44 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED; | 44 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED; |
45 public: | 45 public: |
46 enum Restrictor { | 46 enum Restrictor { |
47 Only, Not, None | 47 Only, Not, None |
48 }; | 48 }; |
49 | 49 |
| 50 static PassOwnPtrWillBeRawPtr<MediaQuery> createNotAll(); |
| 51 |
50 MediaQuery(Restrictor, const String& mediaType, PassOwnPtrWillBeRawPtr<Expre
ssionHeapVector> exprs); | 52 MediaQuery(Restrictor, const String& mediaType, PassOwnPtrWillBeRawPtr<Expre
ssionHeapVector> exprs); |
51 ~MediaQuery(); | 53 ~MediaQuery(); |
52 | 54 |
53 Restrictor restrictor() const { return m_restrictor; } | 55 Restrictor restrictor() const { return m_restrictor; } |
54 const ExpressionHeapVector& expressions() const { return *m_expressions; } | 56 const ExpressionHeapVector& expressions() const { return *m_expressions; } |
55 const String& mediaType() const { return m_mediaType; } | 57 const String& mediaType() const { return m_mediaType; } |
56 bool operator==(const MediaQuery& other) const; | 58 bool operator==(const MediaQuery& other) const; |
57 String cssText() const; | 59 String cssText() const; |
58 | 60 |
59 PassOwnPtrWillBeRawPtr<MediaQuery> copy() const { return adoptPtrWillBeNoop(
new MediaQuery(*this)); } | 61 PassOwnPtrWillBeRawPtr<MediaQuery> copy() const { return adoptPtrWillBeNoop(
new MediaQuery(*this)); } |
60 | 62 |
61 void trace(Visitor*); | 63 void trace(Visitor*); |
62 | 64 |
63 private: | 65 private: |
64 MediaQuery(const MediaQuery&); | 66 MediaQuery(const MediaQuery&); |
65 | 67 |
66 Restrictor m_restrictor; | 68 Restrictor m_restrictor; |
67 String m_mediaType; | 69 String m_mediaType; |
68 OwnPtrWillBeMember<ExpressionHeapVector> m_expressions; | 70 OwnPtrWillBeMember<ExpressionHeapVector> m_expressions; |
69 String m_serializationCache; | 71 String m_serializationCache; |
70 | 72 |
71 String serialize() const; | 73 String serialize() const; |
72 }; | 74 }; |
73 | 75 |
74 } // namespace | 76 } // namespace |
75 | 77 |
76 #endif | 78 #endif |
OLD | NEW |