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 28 matching lines...) Expand all Loading... |
39 | 39 |
40 typedef Vector<OwnPtr<MediaQueryExp> > ExpressionVector; | 40 typedef Vector<OwnPtr<MediaQueryExp> > ExpressionVector; |
41 | 41 |
42 class MediaQuery { | 42 class MediaQuery { |
43 WTF_MAKE_FAST_ALLOCATED; | 43 WTF_MAKE_FAST_ALLOCATED; |
44 public: | 44 public: |
45 enum Restrictor { | 45 enum Restrictor { |
46 Only, Not, None | 46 Only, Not, None |
47 }; | 47 }; |
48 | 48 |
49 MediaQuery(Restrictor, const AtomicString& mediaType, PassOwnPtr<ExpressionV
ector> exprs); | 49 MediaQuery(Restrictor, const String& mediaType, PassOwnPtr<ExpressionVector>
exprs); |
50 ~MediaQuery(); | 50 ~MediaQuery(); |
51 | 51 |
52 Restrictor restrictor() const { return m_restrictor; } | 52 Restrictor restrictor() const { return m_restrictor; } |
53 const ExpressionVector& expressions() const { return *m_expressions; } | 53 const ExpressionVector& expressions() const { return *m_expressions; } |
54 const AtomicString& mediaType() const { return m_mediaType; } | 54 const String& mediaType() const { return m_mediaType; } |
55 bool operator==(const MediaQuery& other) const; | 55 bool operator==(const MediaQuery& other) const; |
56 String cssText() const; | 56 String cssText() const; |
57 | 57 |
58 PassOwnPtr<MediaQuery> copy() const { return adoptPtr(new MediaQuery(*this))
; } | 58 PassOwnPtr<MediaQuery> copy() const { return adoptPtr(new MediaQuery(*this))
; } |
59 | 59 |
60 private: | 60 private: |
61 MediaQuery(const MediaQuery&); | 61 MediaQuery(const MediaQuery&); |
62 | 62 |
63 Restrictor m_restrictor; | 63 Restrictor m_restrictor; |
64 AtomicString m_mediaType; | 64 String m_mediaType; |
65 OwnPtr<ExpressionVector> m_expressions; | 65 OwnPtr<ExpressionVector> m_expressions; |
66 String m_serializationCache; | 66 String m_serializationCache; |
67 | 67 |
68 String serialize() const; | 68 String serialize() const; |
69 }; | 69 }; |
70 | 70 |
71 } // namespace | 71 } // namespace |
72 | 72 |
73 #endif | 73 #endif |
OLD | NEW |