| 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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 return toStyleRulePage(this)->copy(); | 180 return toStyleRulePage(this)->copy(); |
| 181 case FontFace: | 181 case FontFace: |
| 182 return toStyleRuleFontFace(this)->copy(); | 182 return toStyleRuleFontFace(this)->copy(); |
| 183 case Media: | 183 case Media: |
| 184 return toStyleRuleMedia(this)->copy(); | 184 return toStyleRuleMedia(this)->copy(); |
| 185 case Supports: | 185 case Supports: |
| 186 return toStyleRuleSupports(this)->copy(); | 186 return toStyleRuleSupports(this)->copy(); |
| 187 case Import: | 187 case Import: |
| 188 // FIXME: Copy import rules. | 188 // FIXME: Copy import rules. |
| 189 ASSERT_NOT_REACHED(); | 189 ASSERT_NOT_REACHED(); |
| 190 return 0; | 190 return nullptr; |
| 191 case Keyframes: | 191 case Keyframes: |
| 192 return toStyleRuleKeyframes(this)->copy(); | 192 return toStyleRuleKeyframes(this)->copy(); |
| 193 case Viewport: | 193 case Viewport: |
| 194 return toStyleRuleViewport(this)->copy(); | 194 return toStyleRuleViewport(this)->copy(); |
| 195 case Filter: | 195 case Filter: |
| 196 return toStyleRuleFilter(this)->copy(); | 196 return toStyleRuleFilter(this)->copy(); |
| 197 case Unknown: | 197 case Unknown: |
| 198 case Charset: | 198 case Charset: |
| 199 case Keyframe: | 199 case Keyframe: |
| 200 ASSERT_NOT_REACHED(); | 200 ASSERT_NOT_REACHED(); |
| 201 return 0; | 201 return nullptr; |
| 202 } | 202 } |
| 203 ASSERT_NOT_REACHED(); | 203 ASSERT_NOT_REACHED(); |
| 204 return 0; | 204 return nullptr; |
| 205 } | 205 } |
| 206 | 206 |
| 207 PassRefPtr<CSSRule> StyleRuleBase::createCSSOMWrapper(CSSStyleSheet* parentSheet
, CSSRule* parentRule) const | 207 PassRefPtr<CSSRule> StyleRuleBase::createCSSOMWrapper(CSSStyleSheet* parentSheet
, CSSRule* parentRule) const |
| 208 { | 208 { |
| 209 RefPtr<CSSRule> rule; | 209 RefPtr<CSSRule> rule; |
| 210 StyleRuleBase* self = const_cast<StyleRuleBase*>(this); | 210 StyleRuleBase* self = const_cast<StyleRuleBase*>(this); |
| 211 switch (type()) { | 211 switch (type()) { |
| 212 case Style: | 212 case Style: |
| 213 rule = CSSStyleRule::create(toStyleRule(self), parentSheet); | 213 rule = CSSStyleRule::create(toStyleRule(self), parentSheet); |
| 214 break; | 214 break; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 233 case Viewport: | 233 case Viewport: |
| 234 rule = CSSViewportRule::create(toStyleRuleViewport(self), parentSheet); | 234 rule = CSSViewportRule::create(toStyleRuleViewport(self), parentSheet); |
| 235 break; | 235 break; |
| 236 case Filter: | 236 case Filter: |
| 237 rule = CSSFilterRule::create(toStyleRuleFilter(self), parentSheet); | 237 rule = CSSFilterRule::create(toStyleRuleFilter(self), parentSheet); |
| 238 break; | 238 break; |
| 239 case Unknown: | 239 case Unknown: |
| 240 case Charset: | 240 case Charset: |
| 241 case Keyframe: | 241 case Keyframe: |
| 242 ASSERT_NOT_REACHED(); | 242 ASSERT_NOT_REACHED(); |
| 243 return 0; | 243 return nullptr; |
| 244 } | 244 } |
| 245 if (parentRule) | 245 if (parentRule) |
| 246 rule->setParentRule(parentRule); | 246 rule->setParentRule(parentRule); |
| 247 return rule.release(); | 247 return rule.release(); |
| 248 } | 248 } |
| 249 | 249 |
| 250 unsigned StyleRule::averageSizeInBytes() | 250 unsigned StyleRule::averageSizeInBytes() |
| 251 { | 251 { |
| 252 return sizeof(StyleRule) + sizeof(CSSSelector) + StylePropertySet::averageSi
zeInBytes(); | 252 return sizeof(StyleRule) + sizeof(CSSSelector) + StylePropertySet::averageSi
zeInBytes(); |
| 253 } | 253 } |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 436 m_properties = m_properties->mutableCopy(); | 436 m_properties = m_properties->mutableCopy(); |
| 437 return toMutableStylePropertySet(m_properties); | 437 return toMutableStylePropertySet(m_properties); |
| 438 } | 438 } |
| 439 | 439 |
| 440 void StyleRuleFilter::setProperties(PassRefPtr<StylePropertySet> properties) | 440 void StyleRuleFilter::setProperties(PassRefPtr<StylePropertySet> properties) |
| 441 { | 441 { |
| 442 m_properties = properties; | 442 m_properties = properties; |
| 443 } | 443 } |
| 444 | 444 |
| 445 } // namespace WebCore | 445 } // namespace WebCore |
| OLD | NEW |