Eliminate CSSElementStyleDeclaration
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 23 Jan 2012 22:26:21 +0000 (22:26 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 23 Jan 2012 22:26:21 +0000 (22:26 +0000)
commit241a650fbcd8223392be0a013542a90c41455652
treee0f28889116b7a359c35ef5a68d127e5436e0d31
parent2436e67e7b1c46c64223d9ef2c6b909eab32ceae
Eliminate CSSElementStyleDeclaration
https://bugs.webkit.org/show_bug.cgi?id=76848

Reviewed by Andreas Kling.

CSSElementStyleDeclaration has little functionality. It can merge with CSSMutableStyleDeclaration simplifying the code.

Having an element parent is mutually exclusive with having a css rule parent. We can keep them in a union. This also
shrinks all inline style declarations by one pointer.

* CMakeLists.txt:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSDOMBinding.h:
(WebCore::root):
* css/CSSAllInOne.cpp:
* css/CSSElementStyleDeclaration.cpp: Removed.
* css/CSSElementStyleDeclaration.h: Removed.
* css/CSSMutableStyleDeclaration.cpp:
(WebCore::CSSMutableStyleDeclaration::setNeedsStyleRecalc):
* css/CSSMutableStyleDeclaration.h:
(WebCore::CSSMutableStyleDeclaration::createInline):
(WebCore::CSSMutableStyleDeclaration::createForSVGFontFaceElement):
(WebCore::CSSMutableStyleDeclaration::CSSMutableStyleDeclaration):
* css/CSSStyleDeclaration.cpp:
(WebCore::CSSStyleDeclaration::CSSStyleDeclaration):
(WebCore::CSSStyleDeclaration::parentStyleSheet):

    Merge the CSSElementStyleDeclaration::styleSheet() logic here.

* css/CSSStyleDeclaration.h:
(WebCore::CSSStyleDeclaration::parentRule):
(WebCore::CSSStyleDeclaration::clearParentRule):
(WebCore::CSSStyleDeclaration::parentElement):
(WebCore::CSSStyleDeclaration::clearParentElement):
* css/CSSStyleRule.cpp:
(WebCore::CSSStyleRule::setSelectorText):

    CSSStyleRule's style declaration can't have isElementStyleDeclaration set, the dead code can be removed.
    This is asserted in setDeclaration() and again implicitly in the destructor (by clearParentRule()).

* dom/StyledElement.cpp:
(WebCore::StyledElement::createInlineStyleDecl):
(WebCore::StyledElement::destroyInlineStyleDecl):
(WebCore::StyledElement::ensureInlineStyleDecl):
(WebCore::StyledElement::copyNonAttributeProperties):
* dom/StyledElement.h:
(WebCore::StyledElement::inlineStyleDecl):
* editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::applyRelativeFontStyleChange):
(WebCore::ApplyStyleCommand::addInlineStyleIfNeeded):
* editing/DeleteButtonController.cpp:
(WebCore::DeleteButtonController::createDeletionUI):
* html/ValidationMessage.cpp:
(WebCore::adjustBubblePosition):
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlPanelElement::setPosition):
(WebCore::MediaControlPanelElement::resetPosition):
(WebCore::MediaControlPanelElement::makeOpaque):
(WebCore::MediaControlPanelElement::makeTransparent):
* html/shadow/SliderThumbElement.cpp:
(WebCore::TrackLimiterElement::create):
* svg/SVGFontFaceElement.cpp:
(WebCore::SVGFontFaceElement::SVGFontFaceElement):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@105642 268f45cc-cd09-0410-ab3c-d52691b4dbfc
26 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.list.am
Source/WebCore/Target.pri
Source/WebCore/WebCore.gypi
Source/WebCore/WebCore.vcproj/WebCore.vcproj
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/js/JSDOMBinding.h
Source/WebCore/css/CSSAllInOne.cpp
Source/WebCore/css/CSSElementStyleDeclaration.cpp [deleted file]
Source/WebCore/css/CSSElementStyleDeclaration.h [deleted file]
Source/WebCore/css/CSSFontFaceRule.cpp
Source/WebCore/css/CSSMutableStyleDeclaration.cpp
Source/WebCore/css/CSSMutableStyleDeclaration.h
Source/WebCore/css/CSSStyleDeclaration.cpp
Source/WebCore/css/CSSStyleDeclaration.h
Source/WebCore/css/CSSStyleRule.cpp
Source/WebCore/css/CSSStyleRule.h
Source/WebCore/dom/StyledElement.cpp
Source/WebCore/dom/StyledElement.h
Source/WebCore/editing/ApplyStyleCommand.cpp
Source/WebCore/editing/DeleteButtonController.cpp
Source/WebCore/html/ValidationMessage.cpp
Source/WebCore/html/shadow/MediaControlElements.cpp
Source/WebCore/html/shadow/SliderThumbElement.cpp
Source/WebCore/svg/SVGFontFaceElement.cpp