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, 2005, 2006, 2008, 2012 Apple Inc. All rights reserved. | 4 * Copyright (C) 2002, 2005, 2006, 2008, 2012 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 } | 49 } |
50 | 50 |
51 PassRefPtrWillBeRawPtr<CSSRule> StyleRuleBase::createCSSOMWrapper(CSSRule* paren
tRule) const | 51 PassRefPtrWillBeRawPtr<CSSRule> StyleRuleBase::createCSSOMWrapper(CSSRule* paren
tRule) const |
52 { | 52 { |
53 return createCSSOMWrapper(0, parentRule); | 53 return createCSSOMWrapper(0, parentRule); |
54 } | 54 } |
55 | 55 |
56 DEFINE_TRACE(StyleRuleBase) | 56 DEFINE_TRACE(StyleRuleBase) |
57 { | 57 { |
58 switch (type()) { | 58 switch (type()) { |
| 59 case Charset: |
| 60 toStyleRuleCharset(this)->traceAfterDispatch(visitor); |
| 61 return; |
59 case Style: | 62 case Style: |
60 toStyleRule(this)->traceAfterDispatch(visitor); | 63 toStyleRule(this)->traceAfterDispatch(visitor); |
61 return; | 64 return; |
62 case Page: | 65 case Page: |
63 toStyleRulePage(this)->traceAfterDispatch(visitor); | 66 toStyleRulePage(this)->traceAfterDispatch(visitor); |
64 return; | 67 return; |
65 case FontFace: | 68 case FontFace: |
66 toStyleRuleFontFace(this)->traceAfterDispatch(visitor); | 69 toStyleRuleFontFace(this)->traceAfterDispatch(visitor); |
67 return; | 70 return; |
68 case Media: | 71 case Media: |
(...skipping 19 matching lines...) Expand all Loading... |
88 return; | 91 return; |
89 case Unknown: | 92 case Unknown: |
90 break; | 93 break; |
91 } | 94 } |
92 ASSERT_NOT_REACHED(); | 95 ASSERT_NOT_REACHED(); |
93 } | 96 } |
94 | 97 |
95 void StyleRuleBase::finalizeGarbageCollectedObject() | 98 void StyleRuleBase::finalizeGarbageCollectedObject() |
96 { | 99 { |
97 switch (type()) { | 100 switch (type()) { |
| 101 case Charset: |
| 102 toStyleRuleCharset(this)->~StyleRuleCharset(); |
| 103 return; |
98 case Style: | 104 case Style: |
99 toStyleRule(this)->~StyleRule(); | 105 toStyleRule(this)->~StyleRule(); |
100 return; | 106 return; |
101 case Page: | 107 case Page: |
102 toStyleRulePage(this)->~StyleRulePage(); | 108 toStyleRulePage(this)->~StyleRulePage(); |
103 return; | 109 return; |
104 case FontFace: | 110 case FontFace: |
105 toStyleRuleFontFace(this)->~StyleRuleFontFace(); | 111 toStyleRuleFontFace(this)->~StyleRuleFontFace(); |
106 return; | 112 return; |
107 case Media: | 113 case Media: |
(...skipping 19 matching lines...) Expand all Loading... |
127 return; | 133 return; |
128 case Unknown: | 134 case Unknown: |
129 return; | 135 return; |
130 } | 136 } |
131 ASSERT_NOT_REACHED(); | 137 ASSERT_NOT_REACHED(); |
132 } | 138 } |
133 | 139 |
134 void StyleRuleBase::destroy() | 140 void StyleRuleBase::destroy() |
135 { | 141 { |
136 switch (type()) { | 142 switch (type()) { |
| 143 case Charset: |
| 144 delete toStyleRuleCharset(this); |
| 145 return; |
137 case Style: | 146 case Style: |
138 delete toStyleRule(this); | 147 delete toStyleRule(this); |
139 return; | 148 return; |
140 case Page: | 149 case Page: |
141 delete toStyleRulePage(this); | 150 delete toStyleRulePage(this); |
142 return; | 151 return; |
143 case FontFace: | 152 case FontFace: |
144 delete toStyleRuleFontFace(this); | 153 delete toStyleRuleFontFace(this); |
145 return; | 154 return; |
146 case Media: | 155 case Media: |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 case Supports: | 193 case Supports: |
185 return toStyleRuleSupports(this)->copy(); | 194 return toStyleRuleSupports(this)->copy(); |
186 case Import: | 195 case Import: |
187 // FIXME: Copy import rules. | 196 // FIXME: Copy import rules. |
188 ASSERT_NOT_REACHED(); | 197 ASSERT_NOT_REACHED(); |
189 return nullptr; | 198 return nullptr; |
190 case Keyframes: | 199 case Keyframes: |
191 return toStyleRuleKeyframes(this)->copy(); | 200 return toStyleRuleKeyframes(this)->copy(); |
192 case Viewport: | 201 case Viewport: |
193 return toStyleRuleViewport(this)->copy(); | 202 return toStyleRuleViewport(this)->copy(); |
| 203 case Charset: |
194 case Keyframe: | 204 case Keyframe: |
195 case Namespace: | 205 case Namespace: |
196 case Unknown: | 206 case Unknown: |
197 ASSERT_NOT_REACHED(); | 207 ASSERT_NOT_REACHED(); |
198 return nullptr; | 208 return nullptr; |
199 } | 209 } |
200 ASSERT_NOT_REACHED(); | 210 ASSERT_NOT_REACHED(); |
201 return nullptr; | 211 return nullptr; |
202 } | 212 } |
203 | 213 |
(...skipping 21 matching lines...) Expand all Loading... |
225 rule = CSSImportRule::create(toStyleRuleImport(self), parentSheet); | 235 rule = CSSImportRule::create(toStyleRuleImport(self), parentSheet); |
226 break; | 236 break; |
227 case Keyframes: | 237 case Keyframes: |
228 rule = CSSKeyframesRule::create(toStyleRuleKeyframes(self), parentSheet)
; | 238 rule = CSSKeyframesRule::create(toStyleRuleKeyframes(self), parentSheet)
; |
229 break; | 239 break; |
230 case Viewport: | 240 case Viewport: |
231 rule = CSSViewportRule::create(toStyleRuleViewport(self), parentSheet); | 241 rule = CSSViewportRule::create(toStyleRuleViewport(self), parentSheet); |
232 break; | 242 break; |
233 case Keyframe: | 243 case Keyframe: |
234 case Namespace: | 244 case Namespace: |
| 245 case Charset: |
235 case Unknown: | 246 case Unknown: |
236 ASSERT_NOT_REACHED(); | 247 ASSERT_NOT_REACHED(); |
237 return nullptr; | 248 return nullptr; |
238 } | 249 } |
239 if (parentRule) | 250 if (parentRule) |
240 rule->setParentRule(parentRule); | 251 rule->setParentRule(parentRule); |
241 return rule.release(); | 252 return rule.release(); |
242 } | 253 } |
243 | 254 |
244 unsigned StyleRule::averageSizeInBytes() | 255 unsigned StyleRule::averageSizeInBytes() |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 m_properties = properties; | 448 m_properties = properties; |
438 } | 449 } |
439 | 450 |
440 DEFINE_TRACE_AFTER_DISPATCH(StyleRuleViewport) | 451 DEFINE_TRACE_AFTER_DISPATCH(StyleRuleViewport) |
441 { | 452 { |
442 visitor->trace(m_properties); | 453 visitor->trace(m_properties); |
443 StyleRuleBase::traceAfterDispatch(visitor); | 454 StyleRuleBase::traceAfterDispatch(visitor); |
444 } | 455 } |
445 | 456 |
446 } // namespace blink | 457 } // namespace blink |
OLD | NEW |