OLD | NEW |
1 /* | 1 /* |
2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) | 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) |
3 * (C) 2002-2003 Dirk Mueller (mueller@kde.org) | 3 * (C) 2002-2003 Dirk Mueller (mueller@kde.org) |
4 * Copyright (C) 2002, 2006, 2008, 2012, 2013 Apple Inc. All rights reserved. | 4 * Copyright (C) 2002, 2006, 2008, 2012, 2013 Apple Inc. All rights reserved. |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 }; | 99 }; |
100 | 100 |
101 class StyleRule : public StyleRuleBase { | 101 class StyleRule : public StyleRuleBase { |
102 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED; | 102 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED; |
103 public: | 103 public: |
104 static PassRefPtrWillBeRawPtr<StyleRule> create() { return adoptRefWillBeNoo
p(new StyleRule()); } | 104 static PassRefPtrWillBeRawPtr<StyleRule> create() { return adoptRefWillBeNoo
p(new StyleRule()); } |
105 | 105 |
106 ~StyleRule(); | 106 ~StyleRule(); |
107 | 107 |
108 const CSSSelectorList& selectorList() const { return m_selectorList; } | 108 const CSSSelectorList& selectorList() const { return m_selectorList; } |
109 const StylePropertySet* properties() const { return m_properties.get(); } | 109 const StylePropertySet& properties() const { return *m_properties; } |
110 MutableStylePropertySet* mutableProperties(); | 110 MutableStylePropertySet& mutableProperties(); |
111 | 111 |
112 void parserAdoptSelectorVector(Vector<OwnPtr<CSSParserSelector> >& selectors
) { m_selectorList.adoptSelectorVector(selectors); } | 112 void parserAdoptSelectorVector(Vector<OwnPtr<CSSParserSelector> >& selectors
) { m_selectorList.adoptSelectorVector(selectors); } |
113 void wrapperAdoptSelectorList(CSSSelectorList& selectors) { m_selectorList.a
dopt(selectors); } | 113 void wrapperAdoptSelectorList(CSSSelectorList& selectors) { m_selectorList.a
dopt(selectors); } |
114 void setProperties(PassRefPtr<StylePropertySet>); | 114 void setProperties(PassRefPtr<StylePropertySet>); |
115 | 115 |
116 PassRefPtrWillBeRawPtr<StyleRule> copy() const { return adoptRefWillBeNoop(n
ew StyleRule(*this)); } | 116 PassRefPtrWillBeRawPtr<StyleRule> copy() const { return adoptRefWillBeNoop(n
ew StyleRule(*this)); } |
117 | 117 |
118 static unsigned averageSizeInBytes(); | 118 static unsigned averageSizeInBytes(); |
119 | 119 |
120 void traceAfterDispatch(Visitor* visitor) { StyleRuleBase::traceAfterDispatc
h(visitor); } | 120 void traceAfterDispatch(Visitor* visitor) { StyleRuleBase::traceAfterDispatc
h(visitor); } |
121 | 121 |
122 private: | 122 private: |
123 StyleRule(); | 123 StyleRule(); |
124 StyleRule(const StyleRule&); | 124 StyleRule(const StyleRule&); |
125 | 125 |
126 RefPtr<StylePropertySet> m_properties; | 126 RefPtr<StylePropertySet> m_properties; // Cannot be null. |
127 CSSSelectorList m_selectorList; | 127 CSSSelectorList m_selectorList; |
128 }; | 128 }; |
129 | 129 |
130 class StyleRuleFontFace : public StyleRuleBase { | 130 class StyleRuleFontFace : public StyleRuleBase { |
131 public: | 131 public: |
132 static PassRefPtrWillBeRawPtr<StyleRuleFontFace> create() { return adoptRefW
illBeNoop(new StyleRuleFontFace); } | 132 static PassRefPtrWillBeRawPtr<StyleRuleFontFace> create() { return adoptRefW
illBeNoop(new StyleRuleFontFace); } |
133 | 133 |
134 ~StyleRuleFontFace(); | 134 ~StyleRuleFontFace(); |
135 | 135 |
136 const StylePropertySet* properties() const { return m_properties.get(); } | 136 const StylePropertySet& properties() const { return *m_properties; } |
137 MutableStylePropertySet* mutableProperties(); | 137 MutableStylePropertySet& mutableProperties(); |
138 | 138 |
139 void setProperties(PassRefPtr<StylePropertySet>); | 139 void setProperties(PassRefPtr<StylePropertySet>); |
140 | 140 |
141 PassRefPtrWillBeRawPtr<StyleRuleFontFace> copy() const { return adoptRefWill
BeNoop(new StyleRuleFontFace(*this)); } | 141 PassRefPtrWillBeRawPtr<StyleRuleFontFace> copy() const { return adoptRefWill
BeNoop(new StyleRuleFontFace(*this)); } |
142 | 142 |
143 void traceAfterDispatch(Visitor* visitor) { StyleRuleBase::traceAfterDispatc
h(visitor); } | 143 void traceAfterDispatch(Visitor* visitor) { StyleRuleBase::traceAfterDispatc
h(visitor); } |
144 | 144 |
145 private: | 145 private: |
146 StyleRuleFontFace(); | 146 StyleRuleFontFace(); |
147 StyleRuleFontFace(const StyleRuleFontFace&); | 147 StyleRuleFontFace(const StyleRuleFontFace&); |
148 | 148 |
149 RefPtr<StylePropertySet> m_properties; | 149 RefPtr<StylePropertySet> m_properties; // Cannot be null. |
150 }; | 150 }; |
151 | 151 |
152 class StyleRulePage : public StyleRuleBase { | 152 class StyleRulePage : public StyleRuleBase { |
153 public: | 153 public: |
154 static PassRefPtrWillBeRawPtr<StyleRulePage> create() { return adoptRefWillB
eNoop(new StyleRulePage); } | 154 static PassRefPtrWillBeRawPtr<StyleRulePage> create() { return adoptRefWillB
eNoop(new StyleRulePage); } |
155 | 155 |
156 ~StyleRulePage(); | 156 ~StyleRulePage(); |
157 | 157 |
158 const CSSSelector* selector() const { return m_selectorList.first(); } | 158 const CSSSelector* selector() const { return m_selectorList.first(); } |
159 const StylePropertySet* properties() const { return m_properties.get(); } | 159 const StylePropertySet& properties() const { return *m_properties; } |
160 MutableStylePropertySet* mutableProperties(); | 160 MutableStylePropertySet& mutableProperties(); |
161 | 161 |
162 void parserAdoptSelectorVector(Vector<OwnPtr<CSSParserSelector> >& selectors
) { m_selectorList.adoptSelectorVector(selectors); } | 162 void parserAdoptSelectorVector(Vector<OwnPtr<CSSParserSelector> >& selectors
) { m_selectorList.adoptSelectorVector(selectors); } |
163 void wrapperAdoptSelectorList(CSSSelectorList& selectors) { m_selectorList.a
dopt(selectors); } | 163 void wrapperAdoptSelectorList(CSSSelectorList& selectors) { m_selectorList.a
dopt(selectors); } |
164 void setProperties(PassRefPtr<StylePropertySet>); | 164 void setProperties(PassRefPtr<StylePropertySet>); |
165 | 165 |
166 PassRefPtrWillBeRawPtr<StyleRulePage> copy() const { return adoptRefWillBeNo
op(new StyleRulePage(*this)); } | 166 PassRefPtrWillBeRawPtr<StyleRulePage> copy() const { return adoptRefWillBeNo
op(new StyleRulePage(*this)); } |
167 | 167 |
168 void traceAfterDispatch(Visitor* visitor) { StyleRuleBase::traceAfterDispatc
h(visitor); } | 168 void traceAfterDispatch(Visitor* visitor) { StyleRuleBase::traceAfterDispatc
h(visitor); } |
169 | 169 |
170 private: | 170 private: |
171 StyleRulePage(); | 171 StyleRulePage(); |
172 StyleRulePage(const StyleRulePage&); | 172 StyleRulePage(const StyleRulePage&); |
173 | 173 |
174 RefPtr<StylePropertySet> m_properties; | 174 RefPtr<StylePropertySet> m_properties; // Cannot be null. |
175 CSSSelectorList m_selectorList; | 175 CSSSelectorList m_selectorList; |
176 }; | 176 }; |
177 | 177 |
178 class StyleRuleGroup : public StyleRuleBase { | 178 class StyleRuleGroup : public StyleRuleBase { |
179 public: | 179 public: |
180 const WillBeHeapVector<RefPtrWillBeMember<StyleRuleBase> >& childRules() con
st { return m_childRules; } | 180 const WillBeHeapVector<RefPtrWillBeMember<StyleRuleBase> >& childRules() con
st { return m_childRules; } |
181 | 181 |
182 void wrapperInsertRule(unsigned, PassRefPtrWillBeRawPtr<StyleRuleBase>); | 182 void wrapperInsertRule(unsigned, PassRefPtrWillBeRawPtr<StyleRuleBase>); |
183 void wrapperRemoveRule(unsigned); | 183 void wrapperRemoveRule(unsigned); |
184 | 184 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 String m_conditionText; | 232 String m_conditionText; |
233 bool m_conditionIsSupported; | 233 bool m_conditionIsSupported; |
234 }; | 234 }; |
235 | 235 |
236 class StyleRuleViewport : public StyleRuleBase { | 236 class StyleRuleViewport : public StyleRuleBase { |
237 public: | 237 public: |
238 static PassRefPtrWillBeRawPtr<StyleRuleViewport> create() { return adoptRefW
illBeNoop(new StyleRuleViewport); } | 238 static PassRefPtrWillBeRawPtr<StyleRuleViewport> create() { return adoptRefW
illBeNoop(new StyleRuleViewport); } |
239 | 239 |
240 ~StyleRuleViewport(); | 240 ~StyleRuleViewport(); |
241 | 241 |
242 const StylePropertySet* properties() const { return m_properties.get(); } | 242 const StylePropertySet& properties() const { return *m_properties; } |
243 MutableStylePropertySet* mutableProperties(); | 243 MutableStylePropertySet& mutableProperties(); |
244 | 244 |
245 void setProperties(PassRefPtr<StylePropertySet>); | 245 void setProperties(PassRefPtr<StylePropertySet>); |
246 | 246 |
247 PassRefPtrWillBeRawPtr<StyleRuleViewport> copy() const { return adoptRefWill
BeNoop(new StyleRuleViewport(*this)); } | 247 PassRefPtrWillBeRawPtr<StyleRuleViewport> copy() const { return adoptRefWill
BeNoop(new StyleRuleViewport(*this)); } |
248 | 248 |
249 void traceAfterDispatch(Visitor* visitor) { StyleRuleBase::traceAfterDispatc
h(visitor); } | 249 void traceAfterDispatch(Visitor* visitor) { StyleRuleBase::traceAfterDispatc
h(visitor); } |
250 | 250 |
251 private: | 251 private: |
252 StyleRuleViewport(); | 252 StyleRuleViewport(); |
253 StyleRuleViewport(const StyleRuleViewport&); | 253 StyleRuleViewport(const StyleRuleViewport&); |
254 | 254 |
255 RefPtr<StylePropertySet> m_properties; | 255 RefPtr<StylePropertySet> m_properties; // Cannot be null |
256 }; | 256 }; |
257 | 257 |
258 class StyleRuleFilter : public StyleRuleBase { | 258 class StyleRuleFilter : public StyleRuleBase { |
259 public: | 259 public: |
260 static PassRefPtrWillBeRawPtr<StyleRuleFilter> create(const String& filterNa
me) { return adoptRefWillBeNoop(new StyleRuleFilter(filterName)); } | 260 static PassRefPtrWillBeRawPtr<StyleRuleFilter> create(const String& filterNa
me) { return adoptRefWillBeNoop(new StyleRuleFilter(filterName)); } |
261 | 261 |
262 ~StyleRuleFilter(); | 262 ~StyleRuleFilter(); |
263 | 263 |
264 const String& filterName() const { return m_filterName; } | 264 const String& filterName() const { return m_filterName; } |
265 | 265 |
266 const StylePropertySet* properties() const { return m_properties.get(); } | 266 const StylePropertySet& properties() const { return *m_properties; } |
267 MutableStylePropertySet* mutableProperties(); | 267 MutableStylePropertySet& mutableProperties(); |
268 | 268 |
269 void setProperties(PassRefPtr<StylePropertySet>); | 269 void setProperties(PassRefPtr<StylePropertySet>); |
270 | 270 |
271 PassRefPtrWillBeRawPtr<StyleRuleFilter> copy() const { return adoptRefWillBe
Noop(new StyleRuleFilter(*this)); } | 271 PassRefPtrWillBeRawPtr<StyleRuleFilter> copy() const { return adoptRefWillBe
Noop(new StyleRuleFilter(*this)); } |
272 | 272 |
273 void traceAfterDispatch(Visitor* visitor) { StyleRuleBase::traceAfterDispatc
h(visitor); } | 273 void traceAfterDispatch(Visitor* visitor) { StyleRuleBase::traceAfterDispatc
h(visitor); } |
274 | 274 |
275 private: | 275 private: |
276 StyleRuleFilter(const String&); | 276 StyleRuleFilter(const String&); |
277 StyleRuleFilter(const StyleRuleFilter&); | 277 StyleRuleFilter(const StyleRuleFilter&); |
278 | 278 |
279 String m_filterName; | 279 String m_filterName; |
280 RefPtr<StylePropertySet> m_properties; | 280 RefPtr<StylePropertySet> m_properties; |
281 }; | 281 }; |
282 | 282 |
283 #define DEFINE_STYLE_RULE_TYPE_CASTS(Type) \ | 283 #define DEFINE_STYLE_RULE_TYPE_CASTS(Type) \ |
284 DEFINE_TYPE_CASTS(StyleRule##Type, StyleRuleBase, rule, rule->is##Type##Rule
(), rule.is##Type##Rule()) | 284 DEFINE_TYPE_CASTS(StyleRule##Type, StyleRuleBase, rule, rule->is##Type##Rule
(), rule.is##Type##Rule()) |
285 | 285 |
286 DEFINE_TYPE_CASTS(StyleRule, StyleRuleBase, rule, rule->isStyleRule(), rule.isSt
yleRule()); | 286 DEFINE_TYPE_CASTS(StyleRule, StyleRuleBase, rule, rule->isStyleRule(), rule.isSt
yleRule()); |
287 DEFINE_STYLE_RULE_TYPE_CASTS(FontFace); | 287 DEFINE_STYLE_RULE_TYPE_CASTS(FontFace); |
288 DEFINE_STYLE_RULE_TYPE_CASTS(Page); | 288 DEFINE_STYLE_RULE_TYPE_CASTS(Page); |
289 DEFINE_STYLE_RULE_TYPE_CASTS(Media); | 289 DEFINE_STYLE_RULE_TYPE_CASTS(Media); |
290 DEFINE_STYLE_RULE_TYPE_CASTS(Supports); | 290 DEFINE_STYLE_RULE_TYPE_CASTS(Supports); |
291 DEFINE_STYLE_RULE_TYPE_CASTS(Viewport); | 291 DEFINE_STYLE_RULE_TYPE_CASTS(Viewport); |
292 DEFINE_STYLE_RULE_TYPE_CASTS(Filter); | 292 DEFINE_STYLE_RULE_TYPE_CASTS(Filter); |
293 | 293 |
294 } // namespace WebCore | 294 } // namespace WebCore |
295 | 295 |
296 #endif // StyleRule_h | 296 #endif // StyleRule_h |
OLD | NEW |