OLD | NEW |
1 /* | 1 /* |
2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) | 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) |
3 * Copyright (C) 2004, 2006, 2008, 2009, 2010, 2012 Apple Inc. All rights reserv
ed. | 3 * Copyright (C) 2004, 2006, 2008, 2009, 2010, 2012 Apple Inc. All rights reserv
ed. |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 23 matching lines...) Expand all Loading... |
34 namespace blink { | 34 namespace blink { |
35 | 35 |
36 class CSSRule; | 36 class CSSRule; |
37 class CSSStyleSheet; | 37 class CSSStyleSheet; |
38 class ExceptionState; | 38 class ExceptionState; |
39 class MediaList; | 39 class MediaList; |
40 class MediaQuery; | 40 class MediaQuery; |
41 | 41 |
42 class CORE_EXPORT MediaQuerySet : public GarbageCollected<MediaQuerySet> { | 42 class CORE_EXPORT MediaQuerySet : public GarbageCollected<MediaQuerySet> { |
43 public: | 43 public: |
44 static RawPtr<MediaQuerySet> create() | 44 static MediaQuerySet* create() |
45 { | 45 { |
46 return new MediaQuerySet(); | 46 return new MediaQuerySet(); |
47 } | 47 } |
48 static RawPtr<MediaQuerySet> create(const String& mediaString); | 48 static MediaQuerySet* create(const String& mediaString); |
49 static RawPtr<MediaQuerySet> createOffMainThread(const String& mediaString); | 49 static MediaQuerySet* createOffMainThread(const String& mediaString); |
50 | 50 |
51 bool set(const String&); | 51 bool set(const String&); |
52 bool add(const String&); | 52 bool add(const String&); |
53 bool remove(const String&); | 53 bool remove(const String&); |
54 | 54 |
55 void addMediaQuery(RawPtr<MediaQuery>); | 55 void addMediaQuery(MediaQuery*); |
56 | 56 |
57 const HeapVector<Member<MediaQuery>>& queryVector() const { return m_queries
; } | 57 const HeapVector<Member<MediaQuery>>& queryVector() const { return m_queries
; } |
58 | 58 |
59 String mediaText() const; | 59 String mediaText() const; |
60 | 60 |
61 RawPtr<MediaQuerySet> copy() const { return new MediaQuerySet(*this); } | 61 MediaQuerySet* copy() const { return new MediaQuerySet(*this); } |
62 | 62 |
63 DECLARE_TRACE(); | 63 DECLARE_TRACE(); |
64 | 64 |
65 private: | 65 private: |
66 MediaQuerySet(); | 66 MediaQuerySet(); |
67 MediaQuerySet(const MediaQuerySet&); | 67 MediaQuerySet(const MediaQuerySet&); |
68 | 68 |
69 HeapVector<Member<MediaQuery>> m_queries; | 69 HeapVector<Member<MediaQuery>> m_queries; |
70 }; | 70 }; |
71 | 71 |
72 class MediaList final : public GarbageCollected<MediaList>, public ScriptWrappab
le { | 72 class MediaList final : public GarbageCollected<MediaList>, public ScriptWrappab
le { |
73 DEFINE_WRAPPERTYPEINFO(); | 73 DEFINE_WRAPPERTYPEINFO(); |
74 public: | 74 public: |
75 static RawPtr<MediaList> create(MediaQuerySet* mediaQueries, CSSStyleSheet*
parentSheet) | 75 static MediaList* create(MediaQuerySet* mediaQueries, CSSStyleSheet* parentS
heet) |
76 { | 76 { |
77 return new MediaList(mediaQueries, parentSheet); | 77 return new MediaList(mediaQueries, parentSheet); |
78 } | 78 } |
79 | 79 |
80 static RawPtr<MediaList> create(MediaQuerySet* mediaQueries, CSSRule* parent
Rule) | 80 static MediaList* create(MediaQuerySet* mediaQueries, CSSRule* parentRule) |
81 { | 81 { |
82 return new MediaList(mediaQueries, parentRule); | 82 return new MediaList(mediaQueries, parentRule); |
83 } | 83 } |
84 | 84 |
85 unsigned length() const { return m_mediaQueries->queryVector().size(); } | 85 unsigned length() const { return m_mediaQueries->queryVector().size(); } |
86 String item(unsigned index) const; | 86 String item(unsigned index) const; |
87 void deleteMedium(const String& oldMedium, ExceptionState&); | 87 void deleteMedium(const String& oldMedium, ExceptionState&); |
88 void appendMedium(const String& newMedium, ExceptionState&); | 88 void appendMedium(const String& newMedium, ExceptionState&); |
89 | 89 |
90 String mediaText() const { return m_mediaQueries->mediaText(); } | 90 String mediaText() const { return m_mediaQueries->mediaText(); } |
(...skipping 21 matching lines...) Expand all Loading... |
112 Member<MediaQuerySet> m_mediaQueries; | 112 Member<MediaQuerySet> m_mediaQueries; |
113 // Cleared in ~CSSStyleSheet destructor when oilpan is not enabled. | 113 // Cleared in ~CSSStyleSheet destructor when oilpan is not enabled. |
114 Member<CSSStyleSheet> m_parentStyleSheet; | 114 Member<CSSStyleSheet> m_parentStyleSheet; |
115 // Cleared in the ~CSSMediaRule and ~CSSImportRule destructors when oilpan i
s not enabled. | 115 // Cleared in the ~CSSMediaRule and ~CSSImportRule destructors when oilpan i
s not enabled. |
116 Member<CSSRule> m_parentRule; | 116 Member<CSSRule> m_parentRule; |
117 }; | 117 }; |
118 | 118 |
119 } // namespace blink | 119 } // namespace blink |
120 | 120 |
121 #endif | 121 #endif |
OLD | NEW |