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 30 matching lines...) Expand all Loading... |
41 Unknown, // Not used. | 41 Unknown, // Not used. |
42 Style, | 42 Style, |
43 Charset, // Not used. These are internally strings owned by the style sh
eet. | 43 Charset, // Not used. These are internally strings owned by the style sh
eet. |
44 Import, | 44 Import, |
45 Media, | 45 Media, |
46 FontFace, | 46 FontFace, |
47 Page, | 47 Page, |
48 Keyframes, | 48 Keyframes, |
49 Keyframe, // Not used. These are internally non-rule StyleKeyframe objec
ts. | 49 Keyframe, // Not used. These are internally non-rule StyleKeyframe objec
ts. |
50 Supports = 12, | 50 Supports = 12, |
51 #if ENABLE(CSS_DEVICE_ADAPTATION) | |
52 Viewport = 15, | 51 Viewport = 15, |
53 #endif | |
54 Region = 16, | 52 Region = 16, |
55 Filter = 17, | 53 Filter = 17, |
56 HostInternal = 18, // Spec says Host = 1001, but we can use only 5 bit f
or type(). | 54 HostInternal = 18, // Spec says Host = 1001, but we can use only 5 bit f
or type(). |
57 }; | 55 }; |
58 | 56 |
59 Type type() const { return static_cast<Type>(m_type); } | 57 Type type() const { return static_cast<Type>(m_type); } |
60 | 58 |
61 bool isCharsetRule() const { return type() == Charset; } | 59 bool isCharsetRule() const { return type() == Charset; } |
62 bool isFontFaceRule() const { return type() == FontFace; } | 60 bool isFontFaceRule() const { return type() == FontFace; } |
63 bool isKeyframesRule() const { return type() == Keyframes; } | 61 bool isKeyframesRule() const { return type() == Keyframes; } |
64 bool isMediaRule() const { return type() == Media; } | 62 bool isMediaRule() const { return type() == Media; } |
65 bool isPageRule() const { return type() == Page; } | 63 bool isPageRule() const { return type() == Page; } |
66 bool isStyleRule() const { return type() == Style; } | 64 bool isStyleRule() const { return type() == Style; } |
67 bool isRegionRule() const { return type() == Region; } | 65 bool isRegionRule() const { return type() == Region; } |
68 bool isSupportsRule() const { return type() == Supports; } | 66 bool isSupportsRule() const { return type() == Supports; } |
69 #if ENABLE(CSS_DEVICE_ADAPTATION) | |
70 bool isViewportRule() const { return type() == Viewport; } | 67 bool isViewportRule() const { return type() == Viewport; } |
71 #endif | |
72 bool isImportRule() const { return type() == Import; } | 68 bool isImportRule() const { return type() == Import; } |
73 bool isHostRule() const { return type() == HostInternal; } | 69 bool isHostRule() const { return type() == HostInternal; } |
74 bool isFilterRule() const { return type() == Filter; } | 70 bool isFilterRule() const { return type() == Filter; } |
75 | 71 |
76 PassRefPtr<StyleRuleBase> copy() const; | 72 PassRefPtr<StyleRuleBase> copy() const; |
77 | 73 |
78 int sourceLine() const { return m_sourceLine; } | 74 int sourceLine() const { return m_sourceLine; } |
79 | 75 |
80 void deref() | 76 void deref() |
81 { | 77 { |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 return adoptRef(new StyleRuleHost(adoptRules)); | 265 return adoptRef(new StyleRuleHost(adoptRules)); |
270 } | 266 } |
271 | 267 |
272 PassRefPtr<StyleRuleHost> copy() const { return adoptRef(new StyleRuleHost(*
this)); } | 268 PassRefPtr<StyleRuleHost> copy() const { return adoptRef(new StyleRuleHost(*
this)); } |
273 | 269 |
274 private: | 270 private: |
275 StyleRuleHost(Vector<RefPtr<StyleRuleBase> >& adoptRules) : StyleRuleGroup(H
ostInternal, adoptRules) { } | 271 StyleRuleHost(Vector<RefPtr<StyleRuleBase> >& adoptRules) : StyleRuleGroup(H
ostInternal, adoptRules) { } |
276 StyleRuleHost(const StyleRuleHost& o) : StyleRuleGroup(o) { } | 272 StyleRuleHost(const StyleRuleHost& o) : StyleRuleGroup(o) { } |
277 }; | 273 }; |
278 | 274 |
279 #if ENABLE(CSS_DEVICE_ADAPTATION) | |
280 class StyleRuleViewport : public StyleRuleBase { | 275 class StyleRuleViewport : public StyleRuleBase { |
281 public: | 276 public: |
282 static PassRefPtr<StyleRuleViewport> create() { return adoptRef(new StyleRul
eViewport); } | 277 static PassRefPtr<StyleRuleViewport> create() { return adoptRef(new StyleRul
eViewport); } |
283 | 278 |
284 ~StyleRuleViewport(); | 279 ~StyleRuleViewport(); |
285 | 280 |
286 const StylePropertySet* properties() const { return m_properties.get(); } | 281 const StylePropertySet* properties() const { return m_properties.get(); } |
287 MutableStylePropertySet* mutableProperties(); | 282 MutableStylePropertySet* mutableProperties(); |
288 | 283 |
289 void setProperties(PassRefPtr<StylePropertySet>); | 284 void setProperties(PassRefPtr<StylePropertySet>); |
290 | 285 |
291 PassRefPtr<StyleRuleViewport> copy() const { return adoptRef(new StyleRuleVi
ewport(*this)); } | 286 PassRefPtr<StyleRuleViewport> copy() const { return adoptRef(new StyleRuleVi
ewport(*this)); } |
292 | 287 |
293 void reportDescendantMemoryUsage(MemoryObjectInfo*) const; | 288 void reportDescendantMemoryUsage(MemoryObjectInfo*) const; |
294 | 289 |
295 private: | 290 private: |
296 StyleRuleViewport(); | 291 StyleRuleViewport(); |
297 StyleRuleViewport(const StyleRuleViewport&); | 292 StyleRuleViewport(const StyleRuleViewport&); |
298 | 293 |
299 RefPtr<StylePropertySet> m_properties; | 294 RefPtr<StylePropertySet> m_properties; |
300 }; | 295 }; |
301 #endif // ENABLE(CSS_DEVICE_ADAPTATION) | |
302 | 296 |
303 inline const StyleRuleMedia* toStyleRuleMedia(const StyleRuleGroup* rule) | 297 inline const StyleRuleMedia* toStyleRuleMedia(const StyleRuleGroup* rule) |
304 { | 298 { |
305 ASSERT_WITH_SECURITY_IMPLICATION(!rule || rule->isMediaRule()); | 299 ASSERT_WITH_SECURITY_IMPLICATION(!rule || rule->isMediaRule()); |
306 return static_cast<const StyleRuleMedia*>(rule); | 300 return static_cast<const StyleRuleMedia*>(rule); |
307 } | 301 } |
308 | 302 |
309 inline const StyleRuleSupports* toStyleRuleSupports(const StyleRuleGroup* rule) | 303 inline const StyleRuleSupports* toStyleRuleSupports(const StyleRuleGroup* rule) |
310 { | 304 { |
311 ASSERT_WITH_SECURITY_IMPLICATION(!rule || rule->isSupportsRule()); | 305 ASSERT_WITH_SECURITY_IMPLICATION(!rule || rule->isSupportsRule()); |
(...skipping 27 matching lines...) Expand all Loading... |
339 StyleRuleFilter(const String&); | 333 StyleRuleFilter(const String&); |
340 StyleRuleFilter(const StyleRuleFilter&); | 334 StyleRuleFilter(const StyleRuleFilter&); |
341 | 335 |
342 String m_filterName; | 336 String m_filterName; |
343 RefPtr<StylePropertySet> m_properties; | 337 RefPtr<StylePropertySet> m_properties; |
344 }; | 338 }; |
345 | 339 |
346 } // namespace WebCore | 340 } // namespace WebCore |
347 | 341 |
348 #endif // StyleRule_h | 342 #endif // StyleRule_h |
OLD | NEW |