| 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 case Import: | 81 case Import: |
| 82 static_cast<const StyleRuleImport*>(this)->reportDescendantMemoryUsage(m
emoryObjectInfo); | 82 static_cast<const StyleRuleImport*>(this)->reportDescendantMemoryUsage(m
emoryObjectInfo); |
| 83 return; | 83 return; |
| 84 case Keyframes: | 84 case Keyframes: |
| 85 static_cast<const StyleRuleKeyframes*>(this)->reportDescendantMemoryUsag
e(memoryObjectInfo); | 85 static_cast<const StyleRuleKeyframes*>(this)->reportDescendantMemoryUsag
e(memoryObjectInfo); |
| 86 return; | 86 return; |
| 87 case Supports: | 87 case Supports: |
| 88 case HostInternal: | 88 case HostInternal: |
| 89 static_cast<const StyleRuleHost*>(this)->reportDescendantMemoryUsage(mem
oryObjectInfo); | 89 static_cast<const StyleRuleHost*>(this)->reportDescendantMemoryUsage(mem
oryObjectInfo); |
| 90 return; | 90 return; |
| 91 #if ENABLE(CSS_DEVICE_ADAPTATION) | |
| 92 case Viewport: | 91 case Viewport: |
| 93 static_cast<const StyleRuleViewport*>(this)->reportDescendantMemoryUsage
(memoryObjectInfo); | 92 static_cast<const StyleRuleViewport*>(this)->reportDescendantMemoryUsage
(memoryObjectInfo); |
| 94 return; | 93 return; |
| 95 #endif | |
| 96 case Filter: | 94 case Filter: |
| 97 static_cast<const StyleRuleFilter*>(this)->reportDescendantMemoryUsage(m
emoryObjectInfo); | 95 static_cast<const StyleRuleFilter*>(this)->reportDescendantMemoryUsage(m
emoryObjectInfo); |
| 98 return; | 96 return; |
| 99 case Unknown: | 97 case Unknown: |
| 100 case Charset: | 98 case Charset: |
| 101 case Keyframe: | 99 case Keyframe: |
| 102 ASSERT_NOT_REACHED(); | 100 ASSERT_NOT_REACHED(); |
| 103 return; | 101 return; |
| 104 } | 102 } |
| 105 ASSERT_NOT_REACHED(); | 103 ASSERT_NOT_REACHED(); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 128 return; | 126 return; |
| 129 case Import: | 127 case Import: |
| 130 delete static_cast<StyleRuleImport*>(this); | 128 delete static_cast<StyleRuleImport*>(this); |
| 131 return; | 129 return; |
| 132 case Keyframes: | 130 case Keyframes: |
| 133 delete static_cast<StyleRuleKeyframes*>(this); | 131 delete static_cast<StyleRuleKeyframes*>(this); |
| 134 return; | 132 return; |
| 135 case HostInternal: | 133 case HostInternal: |
| 136 delete static_cast<StyleRuleHost*>(this); | 134 delete static_cast<StyleRuleHost*>(this); |
| 137 return; | 135 return; |
| 138 #if ENABLE(CSS_DEVICE_ADAPTATION) | |
| 139 case Viewport: | 136 case Viewport: |
| 140 delete static_cast<StyleRuleViewport*>(this); | 137 delete static_cast<StyleRuleViewport*>(this); |
| 141 return; | 138 return; |
| 142 #endif | |
| 143 case Filter: | 139 case Filter: |
| 144 delete static_cast<StyleRuleFilter*>(this); | 140 delete static_cast<StyleRuleFilter*>(this); |
| 145 return; | 141 return; |
| 146 case Unknown: | 142 case Unknown: |
| 147 case Charset: | 143 case Charset: |
| 148 case Keyframe: | 144 case Keyframe: |
| 149 ASSERT_NOT_REACHED(); | 145 ASSERT_NOT_REACHED(); |
| 150 return; | 146 return; |
| 151 } | 147 } |
| 152 ASSERT_NOT_REACHED(); | 148 ASSERT_NOT_REACHED(); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 168 case Region: | 164 case Region: |
| 169 return static_cast<const StyleRuleRegion*>(this)->copy(); | 165 return static_cast<const StyleRuleRegion*>(this)->copy(); |
| 170 case Import: | 166 case Import: |
| 171 // FIXME: Copy import rules. | 167 // FIXME: Copy import rules. |
| 172 ASSERT_NOT_REACHED(); | 168 ASSERT_NOT_REACHED(); |
| 173 return 0; | 169 return 0; |
| 174 case Keyframes: | 170 case Keyframes: |
| 175 return static_cast<const StyleRuleKeyframes*>(this)->copy(); | 171 return static_cast<const StyleRuleKeyframes*>(this)->copy(); |
| 176 case HostInternal: | 172 case HostInternal: |
| 177 return static_cast<const StyleRuleHost*>(this)->copy(); | 173 return static_cast<const StyleRuleHost*>(this)->copy(); |
| 178 #if ENABLE(CSS_DEVICE_ADAPTATION) | |
| 179 case Viewport: | 174 case Viewport: |
| 180 return static_cast<const StyleRuleViewport*>(this)->copy(); | 175 return static_cast<const StyleRuleViewport*>(this)->copy(); |
| 181 #endif | |
| 182 case Filter: | 176 case Filter: |
| 183 return static_cast<const StyleRuleFilter*>(this)->copy(); | 177 return static_cast<const StyleRuleFilter*>(this)->copy(); |
| 184 case Unknown: | 178 case Unknown: |
| 185 case Charset: | 179 case Charset: |
| 186 case Keyframe: | 180 case Keyframe: |
| 187 ASSERT_NOT_REACHED(); | 181 ASSERT_NOT_REACHED(); |
| 188 return 0; | 182 return 0; |
| 189 } | 183 } |
| 190 ASSERT_NOT_REACHED(); | 184 ASSERT_NOT_REACHED(); |
| 191 return 0; | 185 return 0; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 213 break; | 207 break; |
| 214 case Region: | 208 case Region: |
| 215 rule = CSSRegionRule::create(static_cast<StyleRuleRegion*>(self), parent
Sheet); | 209 rule = CSSRegionRule::create(static_cast<StyleRuleRegion*>(self), parent
Sheet); |
| 216 break; | 210 break; |
| 217 case Import: | 211 case Import: |
| 218 rule = CSSImportRule::create(static_cast<StyleRuleImport*>(self), parent
Sheet); | 212 rule = CSSImportRule::create(static_cast<StyleRuleImport*>(self), parent
Sheet); |
| 219 break; | 213 break; |
| 220 case Keyframes: | 214 case Keyframes: |
| 221 rule = CSSKeyframesRule::create(static_cast<StyleRuleKeyframes*>(self),
parentSheet); | 215 rule = CSSKeyframesRule::create(static_cast<StyleRuleKeyframes*>(self),
parentSheet); |
| 222 break; | 216 break; |
| 223 #if ENABLE(CSS_DEVICE_ADAPTATION) | |
| 224 case Viewport: | 217 case Viewport: |
| 225 rule = WebKitCSSViewportRule::create(static_cast<StyleRuleViewport*>(sel
f), parentSheet); | 218 rule = CSSViewportRule::create(static_cast<StyleRuleViewport*>(self), pa
rentSheet); |
| 226 break; | 219 break; |
| 227 #endif | |
| 228 case HostInternal: | 220 case HostInternal: |
| 229 rule = CSSHostRule::create(static_cast<StyleRuleHost*>(self), parentShee
t); | 221 rule = CSSHostRule::create(static_cast<StyleRuleHost*>(self), parentShee
t); |
| 230 break; | 222 break; |
| 231 case Filter: | 223 case Filter: |
| 232 rule = CSSFilterRule::create(static_cast<StyleRuleFilter*>(self), parent
Sheet); | 224 rule = CSSFilterRule::create(static_cast<StyleRuleFilter*>(self), parent
Sheet); |
| 233 break; | 225 break; |
| 234 case Unknown: | 226 case Unknown: |
| 235 case Charset: | 227 case Charset: |
| 236 case Keyframe: | 228 case Keyframe: |
| 237 ASSERT_NOT_REACHED(); | 229 ASSERT_NOT_REACHED(); |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 { | 420 { |
| 429 ASSERT(RuntimeEnabledFeatures::cssRegionsEnabled()); | 421 ASSERT(RuntimeEnabledFeatures::cssRegionsEnabled()); |
| 430 } | 422 } |
| 431 | 423 |
| 432 void StyleRuleRegion::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObject
Info) const | 424 void StyleRuleRegion::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObject
Info) const |
| 433 { | 425 { |
| 434 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); | 426 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); |
| 435 info.addMember(m_selectorList, "selectorList"); | 427 info.addMember(m_selectorList, "selectorList"); |
| 436 } | 428 } |
| 437 | 429 |
| 438 #if ENABLE(CSS_DEVICE_ADAPTATION) | |
| 439 StyleRuleViewport::StyleRuleViewport() | 430 StyleRuleViewport::StyleRuleViewport() |
| 440 : StyleRuleBase(Viewport, 0) | 431 : StyleRuleBase(Viewport, 0) |
| 441 { | 432 { |
| 433 ASSERT(RuntimeEnabledFeatures::cssViewportEnabled()); |
| 442 } | 434 } |
| 443 | 435 |
| 444 StyleRuleViewport::StyleRuleViewport(const StyleRuleViewport& o) | 436 StyleRuleViewport::StyleRuleViewport(const StyleRuleViewport& o) |
| 445 : StyleRuleBase(o) | 437 : StyleRuleBase(o) |
| 446 , m_properties(o.m_properties->mutableCopy()) | 438 , m_properties(o.m_properties->mutableCopy()) |
| 447 { | 439 { |
| 440 ASSERT(RuntimeEnabledFeatures::cssViewportEnabled()); |
| 448 } | 441 } |
| 449 | 442 |
| 450 StyleRuleViewport::~StyleRuleViewport() | 443 StyleRuleViewport::~StyleRuleViewport() |
| 451 { | 444 { |
| 452 } | 445 } |
| 453 | 446 |
| 454 MutableStylePropertySet* StyleRuleViewport::mutableProperties() | 447 MutableStylePropertySet* StyleRuleViewport::mutableProperties() |
| 455 { | 448 { |
| 456 if (!m_properties->isMutable()) | 449 if (!m_properties->isMutable()) |
| 457 m_properties = m_properties->mutableCopy(); | 450 m_properties = m_properties->mutableCopy(); |
| 458 return static_cast<MutableStylePropertySet*>(m_properties.get()); | 451 return static_cast<MutableStylePropertySet*>(m_properties.get()); |
| 459 } | 452 } |
| 460 | 453 |
| 461 void StyleRuleViewport::setProperties(PassRefPtr<StylePropertySet> properties) | 454 void StyleRuleViewport::setProperties(PassRefPtr<StylePropertySet> properties) |
| 462 { | 455 { |
| 463 m_properties = properties; | 456 m_properties = properties; |
| 464 } | 457 } |
| 465 | 458 |
| 466 void StyleRuleViewport::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObje
ctInfo) const | 459 void StyleRuleViewport::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObje
ctInfo) const |
| 467 { | 460 { |
| 468 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); | 461 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); |
| 469 info.addMember(m_properties, "properties"); | 462 info.addMember(m_properties, "properties"); |
| 470 } | 463 } |
| 471 #endif // ENABLE(CSS_DEVICE_ADAPTATION) | |
| 472 | 464 |
| 473 StyleRuleFilter::StyleRuleFilter(const String& filterName) | 465 StyleRuleFilter::StyleRuleFilter(const String& filterName) |
| 474 : StyleRuleBase(Filter, 0) | 466 : StyleRuleBase(Filter, 0) |
| 475 , m_filterName(filterName) | 467 , m_filterName(filterName) |
| 476 { | 468 { |
| 477 } | 469 } |
| 478 | 470 |
| 479 StyleRuleFilter::StyleRuleFilter(const StyleRuleFilter& o) | 471 StyleRuleFilter::StyleRuleFilter(const StyleRuleFilter& o) |
| 480 : StyleRuleBase(o) | 472 : StyleRuleBase(o) |
| 481 , m_filterName(o.m_filterName) | 473 , m_filterName(o.m_filterName) |
| (...skipping 18 matching lines...) Expand all Loading... |
| 500 } | 492 } |
| 501 | 493 |
| 502 void StyleRuleFilter::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObject
Info) const | 494 void StyleRuleFilter::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObject
Info) const |
| 503 { | 495 { |
| 504 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); | 496 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); |
| 505 info.addMember(m_filterName); | 497 info.addMember(m_filterName); |
| 506 info.addMember(m_properties); | 498 info.addMember(m_properties); |
| 507 } | 499 } |
| 508 | 500 |
| 509 } // namespace WebCore | 501 } // namespace WebCore |
| OLD | NEW |