Reduce internal use of CSSStyleDeclaration base class
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Jan 2012 16:09:05 +0000 (16:09 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Jan 2012 16:09:05 +0000 (16:09 +0000)
commit1460bd8516cfe5eb5aa4274d30e6e027d32914b1
tree23c56da03ce047ce83820cbd71d3f0f88d5ee72e
parent77cb026e9f80a20d6ccd60e11d040d5348d0d508
Reduce internal use of CSSStyleDeclaration base class
https://bugs.webkit.org/show_bug.cgi?id=76904

Reviewed by Andreas Kling.

Internally WebCore should use the more specific CSSMutableStyleDeclaration and CSSComputedStyleDeclaration types.
The CSSStyleDeclaration base should be used in the DOM API functions only. This will make it easier to separate
internal style sheet implementation from the DOM in the future.

- Switch CSSStyleDeclaration -> CSSMutableStyleDeclaration where feasible
- Use StyledElement::ensureInlineStyleDecl() instead of Element::style() (which is a DOM API function)
- Remove Attribute::style() which looks like a DOM API function but is not exposed.

* css/CSSMutableStyleDeclaration.h:
(WebCore::CSSMutableStyleDeclaration::getPropertyCSSValue):
* dom/Attr.h:
(WebCore::Attr::style):
* dom/Attribute.h:
* editing/EditingStyle.cpp:
(WebCore::HTMLElementEquivalent::propertyExistsInStyle):
(WebCore::HTMLElementEquivalent::valueIsPresentInStyle):
(WebCore::HTMLTextDecorationEquivalent::propertyExistsInStyle):
(WebCore::HTMLTextDecorationEquivalent::valueIsPresentInStyle):
(WebCore::HTMLAttributeEquivalent::valueIsPresentInStyle):
* editing/Editor.cpp:
(WebCore::Editor::applyEditingStyleToElement):
* editing/markup.cpp:
(WebCore::StyledMarkupAccumulator::wrapWithStyleNode):
(WebCore::StyledMarkupAccumulator::appendStyleNodeOpenTag):
(WebCore::propertyMissingOrEqualToNone):
* inspector/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::buildArrayForAttributeStyles):
* page/DragController.cpp:
(WebCore::DragController::concludeEditDrag):
* page/PageSerializer.cpp:
(WebCore::PageSerializer::serializeFrame):
(WebCore::PageSerializer::retrieveResourcesForCSSDeclaration):
* page/PageSerializer.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::resize):
* svg/SVGStyledElement.cpp:
(WebCore::SVGStyledElement::getPresentationAttribute):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@105739 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
Source/WebCore/ChangeLog
Source/WebCore/css/CSSMutableStyleDeclaration.h
Source/WebCore/dom/Attr.h
Source/WebCore/dom/Attribute.h
Source/WebCore/editing/EditingStyle.cpp
Source/WebCore/editing/Editor.cpp
Source/WebCore/editing/markup.cpp
Source/WebCore/inspector/InspectorCSSAgent.cpp
Source/WebCore/page/DragController.cpp
Source/WebCore/page/PageSerializer.cpp
Source/WebCore/page/PageSerializer.h
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/svg/SVGStyledElement.cpp