Make CSSMappedAttributeDeclaration have CSSMutableStyleDeclaration instead of being one
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 Feb 2012 17:41:27 +0000 (17:41 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 Feb 2012 17:41:27 +0000 (17:41 +0000)
commit8ec6b57d1786aac0d48c7b7527aca6a6d5f25dda
treea531eb1e54f3cf9f11af1fd247385a34ed14b6ea
parent5f816066c778041ea592fe03eddf652441021af3
Make CSSMappedAttributeDeclaration have CSSMutableStyleDeclaration instead of being one
https://bugs.webkit.org/show_bug.cgi?id=77545

Reviewed by Andreas Kling.

This is the easiest path for eliminating the last remaining subclass of CSSMutableStyleDeclaration.

On negative side this increases memory use of CSSMappedAttributeDeclaration by one ptr and refcount
(it loses the vptr) in total.

This is not meant to be the end state, just an intermediate refactoring step. CSSMappedAttributeDeclaration
should clearly be renamed too but this patch doesn't do that. It might not exist in its current form
much longer.

* css/CSSMutableStyleDeclaration.cpp:
(WebCore::CSSMutableStyleDeclaration::setProperty):
(WebCore::CSSMutableStyleDeclaration::merge):
* css/CSSMutableStyleDeclaration.h:

    Remove protected section. No subclasses remain.
    Rename setPropertyInternal() to setProperty(). All public methods here are internal.

(CSSMutableStyleDeclaration):
* css/CSSParser.cpp:
(WebCore::CSSParser::parseMappedAttributeValue):
* dom/Attribute.cpp:
(WebCore::Attribute::clone):
* dom/Attribute.h:
(Attribute):
(WebCore::Attribute::decl):
(WebCore::Attribute::mappedAttributeDeclaration):
(WebCore::Attribute::setMappedAttributeDeclaration):
(WebCore::Attribute::Attribute):
* dom/CSSMappedAttributeDeclaration.cpp:
(WebCore::CSSMappedAttributeDeclaration::setMappedImageProperty):
(WebCore::CSSMappedAttributeDeclaration::setMappedProperty):
(WebCore::CSSMappedAttributeDeclaration::removeMappedProperty):
* dom/CSSMappedAttributeDeclaration.h:
(CSSMappedAttributeDeclaration):
(WebCore::CSSMappedAttributeDeclaration::declaration):
(WebCore::CSSMappedAttributeDeclaration::CSSMappedAttributeDeclaration):

    Make CSSMutableStyleDeclaration a member instead of the base class.

* dom/StyledElement.cpp:
(WebCore::StyledElement::attributeChanged):
(WebCore::StyledElement::removeCSSProperty):
(WebCore::StyledElement::addCSSProperty):
(WebCore::StyledElement::addCSSImageProperty):
(WebCore::StyledElement::addCSSLength):
(WebCore::StyledElement::addCSSColor):
(WebCore::StyledElement::createMappedDecl):
* svg/SVGStyledElement.cpp:
(WebCore::SVGStyledElement::getPresentationAttribute):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@106471 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/css/CSSMutableStyleDeclaration.cpp
Source/WebCore/css/CSSMutableStyleDeclaration.h
Source/WebCore/css/CSSParser.cpp
Source/WebCore/dom/Attribute.cpp
Source/WebCore/dom/Attribute.h
Source/WebCore/dom/CSSMappedAttributeDeclaration.cpp
Source/WebCore/dom/CSSMappedAttributeDeclaration.h
Source/WebCore/dom/StyledElement.cpp
Source/WebCore/svg/SVGStyledElement.cpp