Move CSSOM classes to using MutableStylePropertySet over StylePropertySet.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 14 Apr 2013 15:19:59 +0000 (15:19 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 14 Apr 2013 15:19:59 +0000 (15:19 +0000)
commit5393d3fbf717a7b78d95d116a5ad5ed187d5cb24
treedcce62aabdf9fa4339367141829f7c9f0af474ff
parent9f4829edd014ce9cb231088589a7ded135815aab
Move CSSOM classes to using MutableStylePropertySet over StylePropertySet.
<http://webkit.org/b/114581>

Reviewed by Anders Carlsson.

Source/WebCore:

Moved ensureCSSStyleDeclaration() and ensureInlineCSSStyleDeclaration() from StylePropertySet
to MutableStylePropertySet.

StyleRule & co now return a MutableStylePropertySet* from mutableProperties() to aid with...

CSSStyleDeclaration now only deals with MutableStylePropertySets. This was already the case
in practice, we just didn't have any compile-time foot-shooting protection.
In other words, if there's a CSSOM wrapper for a given StylePropertySet, it's guaranteed to
be mutable, and the pointer types now reflect this.

* WebCore.exp.in:
* css/PropertySetCSSStyleDeclaration.cpp:
(WebCore::StyleRuleCSSStyleDeclaration::StyleRuleCSSStyleDeclaration):
(WebCore::StyleRuleCSSStyleDeclaration::reattach):
* css/PropertySetCSSStyleDeclaration.h:
(WebCore::PropertySetCSSStyleDeclaration::PropertySetCSSStyleDeclaration):
(PropertySetCSSStyleDeclaration):
(WebCore::StyleRuleCSSStyleDeclaration::create):
(StyleRuleCSSStyleDeclaration):
(WebCore::InlineCSSStyleDeclaration::InlineCSSStyleDeclaration):
* css/StylePropertySet.cpp:
(WebCore::MutableStylePropertySet::ensureCSSStyleDeclaration):
(WebCore::MutableStylePropertySet::ensureInlineCSSStyleDeclaration):
* css/StylePropertySet.h:
(StylePropertySet):
(MutableStylePropertySet):
* css/StyleRule.cpp:
(WebCore::StyleRule::mutableProperties):
(WebCore::StyleRulePage::mutableProperties):
(WebCore::StyleRuleFontFace::mutableProperties):
(WebCore::StyleRuleViewport::mutableProperties):
(WebCore::StyleRuleFilter::mutableProperties):
* css/StyleRule.h:
(StyleRule):
(StyleRuleFontFace):
(StyleRulePage):
(StyleRuleViewport):
(StyleRuleFilter):
* css/WebKitCSSKeyframeRule.cpp:
(WebCore::StyleKeyframe::mutableProperties):
* css/WebKitCSSKeyframeRule.h:
(StyleKeyframe):
* dom/Attr.cpp:
(WebCore::Attr::style):
* dom/Attr.h:
(Attr):
* editing/EditingStyle.cpp:
(WebCore::EditingStyle::removeStyleAddedByNode):
(WebCore::EditingStyle::removeStyleConflictingWithStyleOfNode):
(WebCore::EditingStyle::triStateOfStyle):
(WebCore::styleFromMatchedRulesForElement):
(WebCore::EditingStyle::removeStyleFromRulesAndContext):
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::copyTypingStyle):
* editing/FrameSelection.h:
* inspector/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::buildObjectForAttributesStyle):

Source/WebKit/gtk:

* WebCoreSupport/EditorClientGtk.cpp:
(WebKit::EditorClient::shouldApplyStyle):

Source/WebKit/mac:

* WebCoreSupport/WebEditorClient.mm:
(WebEditorClient::shouldApplyStyle):
* WebView/WebFrame.mm:
(-[WebFrame _typingStyle]):

Source/WebKit2:

* WebProcess/WebCoreSupport/WebEditorClient.cpp:
(WebKit::WebEditorClient::shouldApplyStyle):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@148396 268f45cc-cd09-0410-ab3c-d52691b4dbfc
23 files changed:
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/css/StyleRule.cpp
Source/WebCore/css/StyleRule.h
Source/WebCore/css/WebKitCSSKeyframeRule.cpp
Source/WebCore/css/WebKitCSSKeyframeRule.h
Source/WebCore/dom/Attr.cpp
Source/WebCore/dom/Attr.h
Source/WebCore/editing/EditingStyle.cpp
Source/WebCore/editing/FrameSelection.cpp
Source/WebCore/editing/FrameSelection.h
Source/WebCore/inspector/InspectorCSSAgent.cpp
Source/WebKit/gtk/ChangeLog
Source/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebCoreSupport/WebEditorClient.mm
Source/WebKit/mac/WebView/WebFrame.mm
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp