Simplify CSSOM style declaration's grabbing at internals.
authorkling@webkit.org <kling@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Aug 2012 17:04:28 +0000 (17:04 +0000)
committerkling@webkit.org <kling@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Aug 2012 17:04:28 +0000 (17:04 +0000)
commitaf8068071c471d41dd2d9e5f3e8d7f425881670f
tree01ce48963742208799467254e52f49ae2caa0bd5
parent9c85d1a7398187b88279e016bd7e85bdb04f5cf9
Simplify CSSOM style declaration's grabbing at internals.
<http://webkit.org/b/93261>

Reviewed by Antti Koivisto.

It was already the case that StylePropertySets exposed in CSSOM were guaranteed mutable,
so remove the mechanism to convert immutable backing objects to mutable ones.

Made ensureCSSStyleDeclaration() non-const to prevent callers that may have an
immutable StylePropertySet from wrapping a CSSOM object around it.

* css/PropertySetCSSStyleDeclaration.h:
(PropertySetCSSStyleDeclaration):
* css/PropertySetCSSStyleDeclaration.cpp:
(WebCore::PropertySetCSSStyleDeclaration::length):
(WebCore::PropertySetCSSStyleDeclaration::item):
(WebCore::PropertySetCSSStyleDeclaration::cssText):
(WebCore::PropertySetCSSStyleDeclaration::setCssText):
(WebCore::PropertySetCSSStyleDeclaration::getPropertyCSSValue):
(WebCore::PropertySetCSSStyleDeclaration::getPropertyValue):
(WebCore::PropertySetCSSStyleDeclaration::getPropertyPriority):
(WebCore::PropertySetCSSStyleDeclaration::getPropertyShorthand):
(WebCore::PropertySetCSSStyleDeclaration::isPropertyImplicit):
(WebCore::PropertySetCSSStyleDeclaration::setProperty):
(WebCore::PropertySetCSSStyleDeclaration::removeProperty):
(WebCore::PropertySetCSSStyleDeclaration::getPropertyCSSValueInternal):
(WebCore::PropertySetCSSStyleDeclaration::getPropertyValueInternal):
(WebCore::PropertySetCSSStyleDeclaration::setPropertyInternal):
(WebCore::PropertySetCSSStyleDeclaration::copy):
(WebCore::PropertySetCSSStyleDeclaration::makeMutable):
(WebCore::PropertySetCSSStyleDeclaration::cssPropertyMatches):

    Remove indirection and access StylePropertySet member directly.

* css/StylePropertySet.h:
* css/StylePropertySet.cpp:
(WebCore::StylePropertySet::ensureCSSStyleDeclaration):
(WebCore::StylePropertySet::ensureInlineCSSStyleDeclaration):

    Made these two non-const. CSSOM wrappers should only ever be constructed around
    mutable StylePropertySets.
    Also added ASSERT(isMutable()).

* inspector/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::buildObjectForAttributesStyle):

    Cast away the constness of StyledElement::attributeStyle(). It's not pretty,
    but these objects are guaranteed mutable, and there's an assertion to protect
    us in ensureCSSStyleDeclaration() if something changes in the future.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@124779 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/css/PropertySetCSSStyleDeclaration.cpp
Source/WebCore/css/PropertySetCSSStyleDeclaration.h
Source/WebCore/css/StylePropertySet.cpp
Source/WebCore/css/StylePropertySet.h
Source/WebCore/inspector/InspectorCSSAgent.cpp