Changeset 106681 in webkit


Ignore:
Timestamp:
Feb 3, 2012 11:46:48 AM (12 years ago)
Author:
Antti Koivisto
Message:

https://bugs.webkit.org/show_bug.cgi?id=77740
Split CSSMutableStyleDeclaration into separate internal and CSSOM types

Reviewed by Andreas Kling and Darin Adler.

Source/WebCore:

Split the CSSMutableStyleDeclaration into an internal type (StylePropertySet) and a CSSOM implementation type (PropertySetCSSStyleDeclaration).

To keep things somewhat manageable, this patch does NOT

  • rename or add any files (so files names won't match types)
  • rename fields, methods or variables to match new type names (like CSSStyleRule::declaration() -> CSSStyleRule::propertySet())
  • try to realize any memory or performance gains (StylePropertySet loses the vptr but gains PropertySetCSSStyleDeclaration*)
  • WebCore.exp.in:
  • css/CSSComputedStyleDeclaration.cpp:

(WebCore::CSSComputedStyleDeclaration::copy):
(WebCore::CSSComputedStyleDeclaration::makeMutable):
(WebCore::CSSComputedStyleDeclaration::copyPropertiesInSet):

  • css/CSSComputedStyleDeclaration.h:

(WebCore):
(CSSComputedStyleDeclaration):

  • css/CSSFontFaceRule.h:

(WebCore::CSSFontFaceRule::style):
(WebCore::CSSFontFaceRule::declaration):
(WebCore::CSSFontFaceRule::setDeclaration):
(CSSFontFaceRule):

  • css/CSSFontSelector.cpp:

(WebCore::CSSFontSelector::addFontFaceRule):

  • css/CSSMutableStyleDeclaration.cpp:

(PropertySetCSSStyleDeclaration):
(WebCore::PropertySetCSSStyleDeclaration::create):
(WebCore::PropertySetCSSStyleDeclaration::PropertySetCSSStyleDeclaration):
(WebCore):
(WebCore::StylePropertySet::StylePropertySet):
(WebCore::StylePropertySet::~StylePropertySet):
(WebCore::StylePropertySet::deref):
(WebCore::StylePropertySet::contextStyleSheet):
(WebCore::StylePropertySet::copyPropertiesFrom):
(WebCore::StylePropertySet::getPropertyValue):
(WebCore::StylePropertySet::borderSpacingValue):
(WebCore::StylePropertySet::appendFontLonghandValueIfExplicit):
(WebCore::StylePropertySet::fontValue):
(WebCore::StylePropertySet::get4Values):
(WebCore::StylePropertySet::getLayeredShorthandValue):
(WebCore::StylePropertySet::getShorthandValue):
(WebCore::StylePropertySet::getCommonValue):
(WebCore::StylePropertySet::getPropertyCSSValue):
(WebCore::StylePropertySet::removeShorthandProperty):
(WebCore::StylePropertySet::removeProperty):
(WebCore::StylePropertySet::setNeedsStyleRecalc):
(WebCore::StylePropertySet::propertyIsImportant):
(WebCore::StylePropertySet::getPropertyShorthand):
(WebCore::StylePropertySet::isPropertyImplicit):
(WebCore::StylePropertySet::setProperty):
(WebCore::StylePropertySet::parseDeclaration):
(WebCore::StylePropertySet::addParsedProperties):
(WebCore::StylePropertySet::addParsedProperty):
(WebCore::StylePropertySet::asText):
(WebCore::StylePropertySet::merge):
(WebCore::StylePropertySet::addSubresourceStyleURLs):
(WebCore::StylePropertySet::copyBlockProperties):
(WebCore::StylePropertySet::removeBlockProperties):
(WebCore::StylePropertySet::removePropertiesInSet):
(WebCore::StylePropertySet::findPropertyWithId):
(WebCore::StylePropertySet::propertyMatches):
(WebCore::StylePropertySet::removeEquivalentProperties):
(WebCore::StylePropertySet::copy):
(WebCore::StylePropertySet::copyPropertiesInSet):
(WebCore::StylePropertySet::ensureCSSStyleDeclaration):
(WebCore::PropertySetCSSStyleDeclaration::length):
(WebCore::PropertySetCSSStyleDeclaration::item):
(WebCore::PropertySetCSSStyleDeclaration::parentRule):
(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::parentStyleSheet):
(WebCore::PropertySetCSSStyleDeclaration::copy):
(WebCore::PropertySetCSSStyleDeclaration::makeMutable):
(WebCore::PropertySetCSSStyleDeclaration::cssPropertyMatches):

  • css/CSSMutableStyleDeclaration.h:

(WebCore):
(StylePropertySet):
(WebCore::StylePropertySet::create):
(WebCore::StylePropertySet::createInline):

  • css/CSSPageRule.h:

(WebCore):

  • css/CSSParser.cpp:

(WebCore::parseColorValue):
(WebCore::parseSimpleLengthValue):
(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::parseDeclaration):
(WebCore::CSSParser::createStyleRule):
(WebCore::CSSParser::createFontFaceRule):
(WebCore::CSSParser::createPageRule):
(WebCore::CSSParser::createKeyframeRule):

  • css/CSSParser.h:

(WebCore):
(CSSParser):

  • css/CSSStyleDeclaration.h:

(WebCore):
(CSSStyleDeclaration):

  • css/CSSStyleRule.h:

(WebCore::CSSStyleRule::style):
(WebCore::CSSStyleRule::setDeclaration):
(WebCore::CSSStyleRule::declaration):
(CSSStyleRule):

  • css/CSSStyleSelector.cpp:

(WebCore::leftToRightDeclaration):
(WebCore::rightToLeftDeclaration):
(WebCore::CSSStyleSelector::addMatchedDeclaration):
(WebCore::CSSStyleSelector::collectMatchingRulesForList):
(WebCore::CSSStyleSelector::matchAllRules):
(WebCore::CSSStyleSelector::styleForKeyframe):
(WebCore::isInsideRegionRule):
(WebCore::CSSStyleSelector::applyDeclaration):
(WebCore::CSSStyleSelector::applyDeclarations):
(WebCore::CSSStyleSelector::matchPageRulesForList):

  • css/CSSStyleSelector.h:

(CSSStyleSelector):
(MatchedStyleDeclaration):

  • css/WebKitCSSKeyframeRule.cpp:

(WebCore::WebKitCSSKeyframeRule::setDeclaration):

  • css/WebKitCSSKeyframeRule.h:

(WebCore::WebKitCSSKeyframeRule::style):
(WebCore::WebKitCSSKeyframeRule::declaration):
(WebKitCSSKeyframeRule):

  • css/WebKitCSSMatrix.cpp:

(WebCore::WebKitCSSMatrix::setMatrixValue):

  • dom/Attr.h:

(WebCore::Attr::style):

  • dom/Attribute.h:

(WebCore::Attribute::decl):

  • dom/CSSMappedAttributeDeclaration.h:

(WebCore::CSSMappedAttributeDeclaration::declaration):
(WebCore::CSSMappedAttributeDeclaration::CSSMappedAttributeDeclaration):
(CSSMappedAttributeDeclaration):

  • dom/Document.cpp:

(WebCore::Document::createCSSStyleDeclaration):

  • dom/ElementAttributeData.h:

(ElementAttributeData):

  • dom/NamedNodeMap.cpp:

(WebCore::NamedNodeMap::ensureInlineStyleDecl):

  • dom/NamedNodeMap.h:

(WebCore::NamedNodeMap::inlineStyleDecl):
(NamedNodeMap):

  • dom/StyledElement.cpp:

(WebCore::StyledElement::updateStyleAttribute):
(WebCore::StyledElement::copyNonAttributeProperties):
(WebCore::StyledElement::addSubresourceAttributeURLs):

  • dom/StyledElement.h:

(WebCore::StyledElement::additionalAttributeStyle):
(WebCore::StyledElement::inlineStyleDecl):
(WebCore::StyledElement::ensureInlineStyleDecl):

  • editing/ApplyStyleCommand.cpp:

(WebCore::ApplyStyleCommand::applyRelativeFontStyleChange):
(WebCore::ApplyStyleCommand::removeEmbeddingUpToEnclosingBlock):
(WebCore::ApplyStyleCommand::applyInlineStyleToNodeRange):
(WebCore::ApplyStyleCommand::removeCSSStyle):
(WebCore::ApplyStyleCommand::addBlockStyle):
(WebCore::ApplyStyleCommand::addInlineStyleIfNeeded):

  • editing/DeleteButtonController.cpp:

(WebCore::DeleteButtonController::createDeletionUI):

  • editing/EditingStyle.cpp:

(WebCore::copyEditingProperties):
(WebCore::editingStyleFromComputedStyle):
(WebCore):
(WebCore::HTMLElementEquivalent::propertyExistsInStyle):
(HTMLElementEquivalent):
(WebCore::HTMLElementEquivalent::valueIsPresentInStyle):
(HTMLTextDecorationEquivalent):
(WebCore::HTMLTextDecorationEquivalent::propertyExistsInStyle):
(WebCore::HTMLTextDecorationEquivalent::valueIsPresentInStyle):
(HTMLAttributeEquivalent):
(WebCore::HTMLAttributeEquivalent::valueIsPresentInStyle):
(WebCore::HTMLAttributeEquivalent::attributeValueAsCSSValue):
(WebCore::EditingStyle::EditingStyle):
(WebCore::getRGBAFontColor):
(WebCore::EditingStyle::setProperty):
(WebCore::EditingStyle::setStyle):
(WebCore::EditingStyle::overrideWithStyle):
(WebCore::EditingStyle::extractAndRemoveTextDirection):
(WebCore::EditingStyle::removeStyleAddedByNode):
(WebCore::EditingStyle::removeStyleConflictingWithStyleOfNode):
(WebCore::EditingStyle::triStateOfStyle):
(WebCore::EditingStyle::conflictsWithInlineStyleOfElement):
(WebCore::EditingStyle::elementIsStyledSpanOrHTMLEquivalent):
(WebCore::elementMatchesAndPropertyIsNotInInlineStyleDecl):
(WebCore::EditingStyle::mergeStyle):
(WebCore::styleFromMatchedRulesForElement):
(WebCore::EditingStyle::mergeStyleFromRules):
(WebCore::EditingStyle::mergeStyleFromRulesForSerialization):
(WebCore::removePropertiesInStyle):
(WebCore::EditingStyle::removeStyleFromRulesAndContext):
(WebCore::EditingStyle::removePropertiesInElementDefaultStyle):
(WebCore::EditingStyle::forceInline):
(WebCore::reconcileTextDecorationProperties):
(WebCore::StyleChange::StyleChange):
(WebCore::setTextDecorationProperty):
(WebCore::StyleChange::extractTextStyles):
(WebCore::diffTextDecorations):
(WebCore::fontWeightIsBold):
(WebCore::getTextAlignment):
(WebCore::getPropertiesNotIn):
(WebCore::getIdentifierValue):
(WebCore::isTransparentColorValue):
(WebCore::hasTransparentBackgroundColor):

  • editing/EditingStyle.h:

(WebCore):
(WebCore::EditingStyle::create):
(EditingStyle):
(WebCore::EditingStyle::style):
(StyleChange):

  • editing/Editor.cpp:

(WebCore::Editor::setBaseWritingDirection):
(WebCore::Editor::applyEditingStyleToElement):

  • editing/EditorCommand.cpp:

(WebCore::applyCommandToFrame):
(WebCore::executeApplyStyle):
(WebCore::executeToggleStyleInList):
(WebCore::executeApplyParagraphStyle):
(WebCore::executeMakeTextWritingDirectionLeftToRight):
(WebCore::executeMakeTextWritingDirectionNatural):
(WebCore::executeMakeTextWritingDirectionRightToLeft):

  • editing/FrameSelection.cpp:

(WebCore::FrameSelection::copyTypingStyle):

  • editing/FrameSelection.h:

(WebCore):

  • editing/RemoveCSSPropertyCommand.cpp:

(WebCore::RemoveCSSPropertyCommand::doApply):
(WebCore::RemoveCSSPropertyCommand::doUnapply):

  • editing/ReplaceSelectionCommand.cpp:

(WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline):

  • editing/ReplaceSelectionCommand.h:

(WebCore):

  • editing/markup.cpp:

(WebCore):
(StyledMarkupAccumulator):
(WebCore::StyledMarkupAccumulator::wrapWithStyleNode):
(WebCore::StyledMarkupAccumulator::appendStyleNodeOpenTag):
(WebCore::propertyMissingOrEqualToNone):

  • html/HTMLTableCellElement.cpp:

(WebCore::HTMLTableCellElement::additionalAttributeStyle):

  • html/HTMLTableCellElement.h:

(HTMLTableCellElement):

  • html/HTMLTableColElement.cpp:

(WebCore::HTMLTableColElement::additionalAttributeStyle):

  • html/HTMLTableColElement.h:

(HTMLTableColElement):

  • html/HTMLTableElement.cpp:

(WebCore::leakBorderStyle):
(WebCore::HTMLTableElement::additionalAttributeStyle):
(WebCore::HTMLTableElement::createSharedCellStyle):
(WebCore::HTMLTableElement::additionalCellStyle):
(WebCore::leakGroupBorderStyle):
(WebCore::HTMLTableElement::additionalGroupStyle):

  • html/HTMLTableElement.h:

(HTMLTableElement):

  • html/HTMLTableSectionElement.cpp:

(WebCore::HTMLTableSectionElement::additionalAttributeStyle):

  • html/HTMLTableSectionElement.h:

(HTMLTableSectionElement):

  • html/ValidationMessage.cpp:

(WebCore::adjustBubblePosition):

  • html/canvas/CanvasRenderingContext2D.cpp:

(WebCore::CanvasRenderingContext2D::setFont):

  • html/shadow/MediaControlElements.cpp:

(WebCore::MediaControlPanelElement::setPosition):
(WebCore::MediaControlPanelElement::resetPosition):
(WebCore::MediaControlPanelElement::makeOpaque):
(WebCore::MediaControlPanelElement::makeTransparent):

  • html/shadow/SliderThumbElement.cpp:

(WebCore::TrackLimiterElement::create):

  • inspector/InspectorCSSAgent.cpp:

(WebCore::InspectorCSSAgent::buildArrayForAttributeStyles):

  • inspector/InspectorStyleSheet.cpp:

(WebCore::InspectorStyle::setPropertyText):
(WebCore::InspectorStyleSheetForInlineStyle::getStyleAttributeRanges):

  • page/DragController.cpp:

(WebCore::DragController::concludeEditDrag):

  • page/PageSerializer.cpp:

(WebCore::PageSerializer::retrieveResourcesForCSSDeclaration):

  • page/PageSerializer.h:

(WebCore):
(PageSerializer):

  • rendering/RenderLayer.cpp:

(WebCore::RenderLayer::resize):

  • rendering/RenderTreeAsText.cpp:

(WebCore::isEmptyOrUnstyledAppleStyleSpan):

  • svg/SVGFontFaceElement.cpp:

(WebCore::SVGFontFaceElement::SVGFontFaceElement):

Source/WebKit/mac:

  • WebView/WebFrame.mm:

(-[WebFrame _typingStyle]):

Source/WebKit/qt:

  • Api/qwebelement.cpp:

(QWebElement::styleProperty):

Location:
trunk/Source
Files:
63 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r106680 r106681  
     12012-02-03  Antti Koivisto  <antti@apple.com>
     2
     3        https://bugs.webkit.org/show_bug.cgi?id=77740
     4        Split CSSMutableStyleDeclaration into separate internal and CSSOM types
     5
     6        Reviewed by Andreas Kling and Darin Adler.
     7
     8        Split the CSSMutableStyleDeclaration into an internal type (StylePropertySet) and a CSSOM implementation type (PropertySetCSSStyleDeclaration).
     9       
     10        To keep things somewhat manageable, this patch does NOT
     11
     12        - rename or add any files (so files names won't match types)
     13        - rename fields, methods or variables to match new type names (like CSSStyleRule::declaration() -> CSSStyleRule::propertySet())
     14        - try to realize any memory or performance gains (StylePropertySet loses the vptr but gains PropertySetCSSStyleDeclaration*)
     15
     16        * WebCore.exp.in:
     17        * css/CSSComputedStyleDeclaration.cpp:
     18        (WebCore::CSSComputedStyleDeclaration::copy):
     19        (WebCore::CSSComputedStyleDeclaration::makeMutable):
     20        (WebCore::CSSComputedStyleDeclaration::copyPropertiesInSet):
     21        * css/CSSComputedStyleDeclaration.h:
     22        (WebCore):
     23        (CSSComputedStyleDeclaration):
     24        * css/CSSFontFaceRule.h:
     25        (WebCore::CSSFontFaceRule::style):
     26        (WebCore::CSSFontFaceRule::declaration):
     27        (WebCore::CSSFontFaceRule::setDeclaration):
     28        (CSSFontFaceRule):
     29        * css/CSSFontSelector.cpp:
     30        (WebCore::CSSFontSelector::addFontFaceRule):
     31        * css/CSSMutableStyleDeclaration.cpp:
     32        (PropertySetCSSStyleDeclaration):
     33        (WebCore::PropertySetCSSStyleDeclaration::create):
     34        (WebCore::PropertySetCSSStyleDeclaration::PropertySetCSSStyleDeclaration):
     35        (WebCore):
     36        (WebCore::StylePropertySet::StylePropertySet):
     37        (WebCore::StylePropertySet::~StylePropertySet):
     38        (WebCore::StylePropertySet::deref):
     39        (WebCore::StylePropertySet::contextStyleSheet):
     40        (WebCore::StylePropertySet::copyPropertiesFrom):
     41        (WebCore::StylePropertySet::getPropertyValue):
     42        (WebCore::StylePropertySet::borderSpacingValue):
     43        (WebCore::StylePropertySet::appendFontLonghandValueIfExplicit):
     44        (WebCore::StylePropertySet::fontValue):
     45        (WebCore::StylePropertySet::get4Values):
     46        (WebCore::StylePropertySet::getLayeredShorthandValue):
     47        (WebCore::StylePropertySet::getShorthandValue):
     48        (WebCore::StylePropertySet::getCommonValue):
     49        (WebCore::StylePropertySet::getPropertyCSSValue):
     50        (WebCore::StylePropertySet::removeShorthandProperty):
     51        (WebCore::StylePropertySet::removeProperty):
     52        (WebCore::StylePropertySet::setNeedsStyleRecalc):
     53        (WebCore::StylePropertySet::propertyIsImportant):
     54        (WebCore::StylePropertySet::getPropertyShorthand):
     55        (WebCore::StylePropertySet::isPropertyImplicit):
     56        (WebCore::StylePropertySet::setProperty):
     57        (WebCore::StylePropertySet::parseDeclaration):
     58        (WebCore::StylePropertySet::addParsedProperties):
     59        (WebCore::StylePropertySet::addParsedProperty):
     60        (WebCore::StylePropertySet::asText):
     61        (WebCore::StylePropertySet::merge):
     62        (WebCore::StylePropertySet::addSubresourceStyleURLs):
     63        (WebCore::StylePropertySet::copyBlockProperties):
     64        (WebCore::StylePropertySet::removeBlockProperties):
     65        (WebCore::StylePropertySet::removePropertiesInSet):
     66        (WebCore::StylePropertySet::findPropertyWithId):
     67        (WebCore::StylePropertySet::propertyMatches):
     68        (WebCore::StylePropertySet::removeEquivalentProperties):
     69        (WebCore::StylePropertySet::copy):
     70        (WebCore::StylePropertySet::copyPropertiesInSet):
     71        (WebCore::StylePropertySet::ensureCSSStyleDeclaration):
     72        (WebCore::PropertySetCSSStyleDeclaration::length):
     73        (WebCore::PropertySetCSSStyleDeclaration::item):
     74        (WebCore::PropertySetCSSStyleDeclaration::parentRule):
     75        (WebCore::PropertySetCSSStyleDeclaration::cssText):
     76        (WebCore::PropertySetCSSStyleDeclaration::setCssText):
     77        (WebCore::PropertySetCSSStyleDeclaration::getPropertyCSSValue):
     78        (WebCore::PropertySetCSSStyleDeclaration::getPropertyValue):
     79        (WebCore::PropertySetCSSStyleDeclaration::getPropertyPriority):
     80        (WebCore::PropertySetCSSStyleDeclaration::getPropertyShorthand):
     81        (WebCore::PropertySetCSSStyleDeclaration::isPropertyImplicit):
     82        (WebCore::PropertySetCSSStyleDeclaration::setProperty):
     83        (WebCore::PropertySetCSSStyleDeclaration::removeProperty):
     84        (WebCore::PropertySetCSSStyleDeclaration::getPropertyCSSValueInternal):
     85        (WebCore::PropertySetCSSStyleDeclaration::getPropertyValueInternal):
     86        (WebCore::PropertySetCSSStyleDeclaration::setPropertyInternal):
     87        (WebCore::PropertySetCSSStyleDeclaration::parentStyleSheet):
     88        (WebCore::PropertySetCSSStyleDeclaration::copy):
     89        (WebCore::PropertySetCSSStyleDeclaration::makeMutable):
     90        (WebCore::PropertySetCSSStyleDeclaration::cssPropertyMatches):
     91        * css/CSSMutableStyleDeclaration.h:
     92        (WebCore):
     93        (StylePropertySet):
     94        (WebCore::StylePropertySet::create):
     95        (WebCore::StylePropertySet::createInline):
     96        * css/CSSPageRule.h:
     97        (WebCore):
     98        * css/CSSParser.cpp:
     99        (WebCore::parseColorValue):
     100        (WebCore::parseSimpleLengthValue):
     101        (WebCore::CSSParser::parseValue):
     102        (WebCore::CSSParser::parseDeclaration):
     103        (WebCore::CSSParser::createStyleRule):
     104        (WebCore::CSSParser::createFontFaceRule):
     105        (WebCore::CSSParser::createPageRule):
     106        (WebCore::CSSParser::createKeyframeRule):
     107        * css/CSSParser.h:
     108        (WebCore):
     109        (CSSParser):
     110        * css/CSSStyleDeclaration.h:
     111        (WebCore):
     112        (CSSStyleDeclaration):
     113        * css/CSSStyleRule.h:
     114        (WebCore::CSSStyleRule::style):
     115        (WebCore::CSSStyleRule::setDeclaration):
     116        (WebCore::CSSStyleRule::declaration):
     117        (CSSStyleRule):
     118        * css/CSSStyleSelector.cpp:
     119        (WebCore::leftToRightDeclaration):
     120        (WebCore::rightToLeftDeclaration):
     121        (WebCore::CSSStyleSelector::addMatchedDeclaration):
     122        (WebCore::CSSStyleSelector::collectMatchingRulesForList):
     123        (WebCore::CSSStyleSelector::matchAllRules):
     124        (WebCore::CSSStyleSelector::styleForKeyframe):
     125        (WebCore::isInsideRegionRule):
     126        (WebCore::CSSStyleSelector::applyDeclaration):
     127        (WebCore::CSSStyleSelector::applyDeclarations):
     128        (WebCore::CSSStyleSelector::matchPageRulesForList):
     129        * css/CSSStyleSelector.h:
     130        (CSSStyleSelector):
     131        (MatchedStyleDeclaration):
     132        * css/WebKitCSSKeyframeRule.cpp:
     133        (WebCore::WebKitCSSKeyframeRule::setDeclaration):
     134        * css/WebKitCSSKeyframeRule.h:
     135        (WebCore::WebKitCSSKeyframeRule::style):
     136        (WebCore::WebKitCSSKeyframeRule::declaration):
     137        (WebKitCSSKeyframeRule):
     138        * css/WebKitCSSMatrix.cpp:
     139        (WebCore::WebKitCSSMatrix::setMatrixValue):
     140        * dom/Attr.h:
     141        (WebCore::Attr::style):
     142        * dom/Attribute.h:
     143        (WebCore::Attribute::decl):
     144        * dom/CSSMappedAttributeDeclaration.h:
     145        (WebCore::CSSMappedAttributeDeclaration::declaration):
     146        (WebCore::CSSMappedAttributeDeclaration::CSSMappedAttributeDeclaration):
     147        (CSSMappedAttributeDeclaration):
     148        * dom/Document.cpp:
     149        (WebCore::Document::createCSSStyleDeclaration):
     150        * dom/ElementAttributeData.h:
     151        (ElementAttributeData):
     152        * dom/NamedNodeMap.cpp:
     153        (WebCore::NamedNodeMap::ensureInlineStyleDecl):
     154        * dom/NamedNodeMap.h:
     155        (WebCore::NamedNodeMap::inlineStyleDecl):
     156        (NamedNodeMap):
     157        * dom/StyledElement.cpp:
     158        (WebCore::StyledElement::updateStyleAttribute):
     159        (WebCore::StyledElement::copyNonAttributeProperties):
     160        (WebCore::StyledElement::addSubresourceAttributeURLs):
     161        * dom/StyledElement.h:
     162        (WebCore::StyledElement::additionalAttributeStyle):
     163        (WebCore::StyledElement::inlineStyleDecl):
     164        (WebCore::StyledElement::ensureInlineStyleDecl):
     165        * editing/ApplyStyleCommand.cpp:
     166        (WebCore::ApplyStyleCommand::applyRelativeFontStyleChange):
     167        (WebCore::ApplyStyleCommand::removeEmbeddingUpToEnclosingBlock):
     168        (WebCore::ApplyStyleCommand::applyInlineStyleToNodeRange):
     169        (WebCore::ApplyStyleCommand::removeCSSStyle):
     170        (WebCore::ApplyStyleCommand::addBlockStyle):
     171        (WebCore::ApplyStyleCommand::addInlineStyleIfNeeded):
     172        * editing/DeleteButtonController.cpp:
     173        (WebCore::DeleteButtonController::createDeletionUI):
     174        * editing/EditingStyle.cpp:
     175        (WebCore::copyEditingProperties):
     176        (WebCore::editingStyleFromComputedStyle):
     177        (WebCore):
     178        (WebCore::HTMLElementEquivalent::propertyExistsInStyle):
     179        (HTMLElementEquivalent):
     180        (WebCore::HTMLElementEquivalent::valueIsPresentInStyle):
     181        (HTMLTextDecorationEquivalent):
     182        (WebCore::HTMLTextDecorationEquivalent::propertyExistsInStyle):
     183        (WebCore::HTMLTextDecorationEquivalent::valueIsPresentInStyle):
     184        (HTMLAttributeEquivalent):
     185        (WebCore::HTMLAttributeEquivalent::valueIsPresentInStyle):
     186        (WebCore::HTMLAttributeEquivalent::attributeValueAsCSSValue):
     187        (WebCore::EditingStyle::EditingStyle):
     188        (WebCore::getRGBAFontColor):
     189        (WebCore::EditingStyle::setProperty):
     190        (WebCore::EditingStyle::setStyle):
     191        (WebCore::EditingStyle::overrideWithStyle):
     192        (WebCore::EditingStyle::extractAndRemoveTextDirection):
     193        (WebCore::EditingStyle::removeStyleAddedByNode):
     194        (WebCore::EditingStyle::removeStyleConflictingWithStyleOfNode):
     195        (WebCore::EditingStyle::triStateOfStyle):
     196        (WebCore::EditingStyle::conflictsWithInlineStyleOfElement):
     197        (WebCore::EditingStyle::elementIsStyledSpanOrHTMLEquivalent):
     198        (WebCore::elementMatchesAndPropertyIsNotInInlineStyleDecl):
     199        (WebCore::EditingStyle::mergeStyle):
     200        (WebCore::styleFromMatchedRulesForElement):
     201        (WebCore::EditingStyle::mergeStyleFromRules):
     202        (WebCore::EditingStyle::mergeStyleFromRulesForSerialization):
     203        (WebCore::removePropertiesInStyle):
     204        (WebCore::EditingStyle::removeStyleFromRulesAndContext):
     205        (WebCore::EditingStyle::removePropertiesInElementDefaultStyle):
     206        (WebCore::EditingStyle::forceInline):
     207        (WebCore::reconcileTextDecorationProperties):
     208        (WebCore::StyleChange::StyleChange):
     209        (WebCore::setTextDecorationProperty):
     210        (WebCore::StyleChange::extractTextStyles):
     211        (WebCore::diffTextDecorations):
     212        (WebCore::fontWeightIsBold):
     213        (WebCore::getTextAlignment):
     214        (WebCore::getPropertiesNotIn):
     215        (WebCore::getIdentifierValue):
     216        (WebCore::isTransparentColorValue):
     217        (WebCore::hasTransparentBackgroundColor):
     218        * editing/EditingStyle.h:
     219        (WebCore):
     220        (WebCore::EditingStyle::create):
     221        (EditingStyle):
     222        (WebCore::EditingStyle::style):
     223        (StyleChange):
     224        * editing/Editor.cpp:
     225        (WebCore::Editor::setBaseWritingDirection):
     226        (WebCore::Editor::applyEditingStyleToElement):
     227        * editing/EditorCommand.cpp:
     228        (WebCore::applyCommandToFrame):
     229        (WebCore::executeApplyStyle):
     230        (WebCore::executeToggleStyleInList):
     231        (WebCore::executeApplyParagraphStyle):
     232        (WebCore::executeMakeTextWritingDirectionLeftToRight):
     233        (WebCore::executeMakeTextWritingDirectionNatural):
     234        (WebCore::executeMakeTextWritingDirectionRightToLeft):
     235        * editing/FrameSelection.cpp:
     236        (WebCore::FrameSelection::copyTypingStyle):
     237        * editing/FrameSelection.h:
     238        (WebCore):
     239        * editing/RemoveCSSPropertyCommand.cpp:
     240        (WebCore::RemoveCSSPropertyCommand::doApply):
     241        (WebCore::RemoveCSSPropertyCommand::doUnapply):
     242        * editing/ReplaceSelectionCommand.cpp:
     243        (WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline):
     244        * editing/ReplaceSelectionCommand.h:
     245        (WebCore):
     246        * editing/markup.cpp:
     247        (WebCore):
     248        (StyledMarkupAccumulator):
     249        (WebCore::StyledMarkupAccumulator::wrapWithStyleNode):
     250        (WebCore::StyledMarkupAccumulator::appendStyleNodeOpenTag):
     251        (WebCore::propertyMissingOrEqualToNone):
     252        * html/HTMLTableCellElement.cpp:
     253        (WebCore::HTMLTableCellElement::additionalAttributeStyle):
     254        * html/HTMLTableCellElement.h:
     255        (HTMLTableCellElement):
     256        * html/HTMLTableColElement.cpp:
     257        (WebCore::HTMLTableColElement::additionalAttributeStyle):
     258        * html/HTMLTableColElement.h:
     259        (HTMLTableColElement):
     260        * html/HTMLTableElement.cpp:
     261        (WebCore::leakBorderStyle):
     262        (WebCore::HTMLTableElement::additionalAttributeStyle):
     263        (WebCore::HTMLTableElement::createSharedCellStyle):
     264        (WebCore::HTMLTableElement::additionalCellStyle):
     265        (WebCore::leakGroupBorderStyle):
     266        (WebCore::HTMLTableElement::additionalGroupStyle):
     267        * html/HTMLTableElement.h:
     268        (HTMLTableElement):
     269        * html/HTMLTableSectionElement.cpp:
     270        (WebCore::HTMLTableSectionElement::additionalAttributeStyle):
     271        * html/HTMLTableSectionElement.h:
     272        (HTMLTableSectionElement):
     273        * html/ValidationMessage.cpp:
     274        (WebCore::adjustBubblePosition):
     275        * html/canvas/CanvasRenderingContext2D.cpp:
     276        (WebCore::CanvasRenderingContext2D::setFont):
     277        * html/shadow/MediaControlElements.cpp:
     278        (WebCore::MediaControlPanelElement::setPosition):
     279        (WebCore::MediaControlPanelElement::resetPosition):
     280        (WebCore::MediaControlPanelElement::makeOpaque):
     281        (WebCore::MediaControlPanelElement::makeTransparent):
     282        * html/shadow/SliderThumbElement.cpp:
     283        (WebCore::TrackLimiterElement::create):
     284        * inspector/InspectorCSSAgent.cpp:
     285        (WebCore::InspectorCSSAgent::buildArrayForAttributeStyles):
     286        * inspector/InspectorStyleSheet.cpp:
     287        (WebCore::InspectorStyle::setPropertyText):
     288        (WebCore::InspectorStyleSheetForInlineStyle::getStyleAttributeRanges):
     289        * page/DragController.cpp:
     290        (WebCore::DragController::concludeEditDrag):
     291        * page/PageSerializer.cpp:
     292        (WebCore::PageSerializer::retrieveResourcesForCSSDeclaration):
     293        * page/PageSerializer.h:
     294        (WebCore):
     295        (PageSerializer):
     296        * rendering/RenderLayer.cpp:
     297        (WebCore::RenderLayer::resize):
     298        * rendering/RenderTreeAsText.cpp:
     299        (WebCore::isEmptyOrUnstyledAppleStyleSpan):
     300        * svg/SVGFontFaceElement.cpp:
     301        (WebCore::SVGFontFaceElement::SVGFontFaceElement):
     302
    13032012-02-03  Jochen Eisinger  <jochen@chromium.org>
    2304
  • trunk/Source/WebCore/WebCore.exp.in

    r106678 r106681  
    519519__ZN7WebCore16ScriptController21processingUserGestureEv
    520520__ZN7WebCore16ScriptController24jsObjectForPluginElementEPNS_17HTMLPlugInElementE
     521__ZN7WebCore16StylePropertySet5derefEv
    521522__ZN7WebCore16ThreadGlobalData10staticDataE
    522523__ZN7WebCore16ThreadGlobalDataC1Ev
     
    674675__ZN7WebCore25contextMenuItemTagOutlineEv
    675676__ZN7WebCore25windowsKeyCodeForKeyEventEP7NSEvent
    676 __ZN7WebCore26CSSMutableStyleDeclarationC1Ev
    677677__ZN7WebCore26UserTypingGestureIndicator27processingUserTypingGestureEv
    678678__ZN7WebCore26UserTypingGestureIndicator28focusedElementAtGestureStartEv
     
    12971297__ZNK7WebCore16IconDatabaseBase12databasePathEv
    12981298__ZNK7WebCore16ResourceResponse13nsURLResponseEv
     1299__ZNK7WebCore16StylePropertySet25ensureCSSStyleDeclarationEv
    12991300__ZNK7WebCore16VisibleSelection17isContentEditableEv
    13001301__ZNK7WebCore16VisibleSelection17toNormalizedRangeEv
  • trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp

    r106568 r106681  
    25152515}
    25162516
    2517 PassRefPtr<CSSMutableStyleDeclaration> CSSComputedStyleDeclaration::copy() const
     2517PassRefPtr<StylePropertySet> CSSComputedStyleDeclaration::copy() const
    25182518{
    25192519    return copyPropertiesInSet(computedProperties, numComputedProperties);
    25202520}
    25212521
    2522 PassRefPtr<CSSMutableStyleDeclaration> CSSComputedStyleDeclaration::makeMutable()
     2522PassRefPtr<StylePropertySet> CSSComputedStyleDeclaration::makeMutable()
    25232523{
    25242524    return copy();
     
    25632563}
    25642564
    2565 PassRefPtr<CSSMutableStyleDeclaration> CSSComputedStyleDeclaration::copyPropertiesInSet(const int* set, unsigned length) const
     2565PassRefPtr<StylePropertySet> CSSComputedStyleDeclaration::copyPropertiesInSet(const int* set, unsigned length) const
    25662566{
    25672567    Vector<CSSProperty> list;
     
    25722572            list.append(CSSProperty(set[i], value.release(), false));
    25732573    }
    2574     return CSSMutableStyleDeclaration::create(list);
     2574    return StylePropertySet::create(list);
    25752575}
    25762576
  • trunk/Source/WebCore/css/CSSComputedStyleDeclaration.h

    r106568 r106681  
    2929namespace WebCore {
    3030
    31 class Color;
    32 class CSSMutableStyleDeclaration;
    3331class CSSPrimitiveValue;
    3432class CSSValueList;
    3533class CSSValuePool;
     34class Color;
    3635class Node;
    3736class RenderStyle;
     37class SVGPaint;
    3838class ShadowData;
    39 class SVGPaint;
     39class StylePropertySet;
    4040
    4141#if ENABLE(CSS_SHADERS)
     
    5555    bool getPropertyPriority(int propertyID) const;
    5656
    57     virtual PassRefPtr<CSSMutableStyleDeclaration> copy() const;
    58     virtual PassRefPtr<CSSMutableStyleDeclaration> makeMutable();
     57    virtual PassRefPtr<StylePropertySet> copy() const;
     58    virtual PassRefPtr<StylePropertySet> makeMutable();
    5959
    6060    PassRefPtr<CSSValue> getPropertyCSSValue(int propertyID, EUpdateLayout) const;
     
    6565#endif
    6666
    67     PassRefPtr<CSSMutableStyleDeclaration> copyPropertiesInSet(const int* set, unsigned length) const;
     67    PassRefPtr<StylePropertySet> copyPropertiesInSet(const int* set, unsigned length) const;
    6868
    6969private:
  • trunk/Source/WebCore/css/CSSFontFaceRule.h

    r106393 r106681  
    4343    ~CSSFontFaceRule();
    4444
    45     CSSStyleDeclaration* style() const { return m_style.get(); }
     45    CSSStyleDeclaration* style() const { return m_style->ensureCSSStyleDeclaration(); }
    4646
    4747    String cssText() const;
    4848
    49     CSSMutableStyleDeclaration* declaration() const { return m_style.get(); }
    50     void setDeclaration(PassRefPtr<CSSMutableStyleDeclaration> style) { m_style = style; }
     49    StylePropertySet* declaration() const { return m_style.get(); }
     50    void setDeclaration(PassRefPtr<StylePropertySet> style) { m_style = style; }
    5151
    5252    void addSubresourceStyleURLs(ListHashSet<KURL>& urls);
     
    5555    CSSFontFaceRule(CSSStyleSheet* parent);
    5656
    57     RefPtr<CSSMutableStyleDeclaration> m_style;
     57    RefPtr<StylePropertySet> m_style;
    5858};
    5959
  • trunk/Source/WebCore/css/CSSFontSelector.cpp

    r106393 r106681  
    8787{
    8888    // Obtain the font-family property and the src property.  Both must be defined.
    89     const CSSMutableStyleDeclaration* style = fontFaceRule->declaration();
     89    const StylePropertySet* style = fontFaceRule->declaration();
    9090    RefPtr<CSSValue> fontFamily = style->getPropertyCSSValue(CSSPropertyFontFamily);
    9191    RefPtr<CSSValue> src = style->getPropertyCSSValue(CSSPropertySrc);
  • trunk/Source/WebCore/css/CSSMutableStyleDeclaration.cpp

    r106568 r106681  
    4646namespace WebCore {
    4747
     48class PropertySetCSSStyleDeclaration : public CSSStyleDeclaration {
     49public:
     50    static PassRefPtr<PropertySetCSSStyleDeclaration> create(PassRefPtr<StylePropertySet> propertySet)
     51    {
     52        return adoptRef(new PropertySetCSSStyleDeclaration(propertySet));
     53    }
     54
     55private:
     56    PropertySetCSSStyleDeclaration(PassRefPtr<StylePropertySet> propertySet) : m_propertySet(propertySet) { }
     57   
     58    virtual CSSRule* parentRule() const OVERRIDE;
     59    virtual unsigned length() const OVERRIDE;
     60    virtual String item(unsigned index) const;
     61    virtual PassRefPtr<CSSValue> getPropertyCSSValue(const String& propertyName) OVERRIDE;
     62    virtual String getPropertyValue(const String& propertyName) OVERRIDE;
     63    virtual String getPropertyPriority(const String& propertyName) OVERRIDE;
     64    virtual String getPropertyShorthand(const String& propertyName) OVERRIDE;
     65    virtual bool isPropertyImplicit(const String& propertyName) OVERRIDE;
     66    virtual void setProperty(const String& propertyName, const String& value, const String& priority, ExceptionCode&) OVERRIDE;
     67    virtual String removeProperty(const String& propertyName, ExceptionCode&) OVERRIDE;
     68    virtual String cssText() const OVERRIDE;
     69    virtual void setCssText(const String&, ExceptionCode&);
     70    virtual PassRefPtr<CSSValue> getPropertyCSSValueInternal(CSSPropertyID) OVERRIDE;
     71    virtual String getPropertyValueInternal(CSSPropertyID) OVERRIDE;
     72    virtual void setPropertyInternal(CSSPropertyID, const String& value, bool important, ExceptionCode&) OVERRIDE;
     73   
     74    virtual bool cssPropertyMatches(const CSSProperty*) const OVERRIDE;
     75    virtual CSSStyleSheet* parentStyleSheet() const OVERRIDE;
     76    virtual PassRefPtr<StylePropertySet> copy() const OVERRIDE;
     77    virtual PassRefPtr<StylePropertySet> makeMutable() OVERRIDE;
     78   
     79    RefPtr<StylePropertySet> m_propertySet;
     80};
     81
    4882namespace {
    4983
     
    5185    WTF_MAKE_NONCOPYABLE(StyleAttributeMutationScope);
    5286public:
    53     StyleAttributeMutationScope(CSSMutableStyleDeclaration* decl)
     87    StyleAttributeMutationScope(StylePropertySet* decl)
    5488    {
    5589        ++s_scopeCount;
     
    93127        }
    94128        // We have to clear internal state before calling Inspector's code.
    95         CSSMutableStyleDeclaration* localCopyStyleDecl = s_currentDecl;
     129        StylePropertySet* localCopyStyleDecl = s_currentDecl;
    96130        s_currentDecl = 0;
    97131        s_shouldNotifyInspector = false;
     
    115149private:
    116150    static unsigned s_scopeCount;
    117     static CSSMutableStyleDeclaration* s_currentDecl;
     151    static StylePropertySet* s_currentDecl;
    118152    static bool s_shouldNotifyInspector;
    119153#if ENABLE(MUTATION_OBSERVERS)
     
    126160
    127161unsigned StyleAttributeMutationScope::s_scopeCount = 0;
    128 CSSMutableStyleDeclaration* StyleAttributeMutationScope::s_currentDecl = 0;
     162StylePropertySet* StyleAttributeMutationScope::s_currentDecl = 0;
    129163bool StyleAttributeMutationScope::s_shouldNotifyInspector = false;
    130164#if ENABLE(MUTATION_OBSERVERS)
     
    134168} // namespace
    135169
    136 CSSMutableStyleDeclaration::CSSMutableStyleDeclaration()
     170StylePropertySet::StylePropertySet()
    137171    : m_strictParsing(false)
    138172    , m_isInlineStyleDeclaration(false)
     
    141175}
    142176
    143 CSSMutableStyleDeclaration::CSSMutableStyleDeclaration(CSSRule* parentRule)
     177StylePropertySet::StylePropertySet(CSSRule* parentRule)
    144178    : m_strictParsing(!parentRule || parentRule->useStrictParsing())
    145179    , m_isInlineStyleDeclaration(false)
     
    148182}
    149183
    150 CSSMutableStyleDeclaration::CSSMutableStyleDeclaration(CSSRule* parentRule, const Vector<CSSProperty>& properties)
     184StylePropertySet::StylePropertySet(CSSRule* parentRule, const Vector<CSSProperty>& properties)
    151185    : m_properties(properties)
    152186    , m_strictParsing(!parentRule || parentRule->useStrictParsing())
     
    155189{
    156190    m_properties.shrinkToFit();
    157     // FIXME: This allows duplicate properties.
    158 }
    159 
    160 CSSMutableStyleDeclaration::CSSMutableStyleDeclaration(CSSRule* parentRule, const CSSProperty* const * properties, int numProperties)
     191}
     192
     193StylePropertySet::StylePropertySet(CSSRule* parentRule, const CSSProperty* const * properties, int numProperties)
    161194    : m_strictParsing(!parentRule || parentRule->useStrictParsing())
    162195    , m_isInlineStyleDeclaration(false)
     
    182215}
    183216
    184 CSSMutableStyleDeclaration::CSSMutableStyleDeclaration(StyledElement* parentElement)
     217StylePropertySet::StylePropertySet(StyledElement* parentElement)
    185218    : m_strictParsing(false)
    186219    , m_isInlineStyleDeclaration(true)
     
    189222}
    190223
    191 CSSMutableStyleDeclaration::~CSSMutableStyleDeclaration()
    192 {
    193 }
    194 
    195 CSSStyleSheet* CSSMutableStyleDeclaration::contextStyleSheet() const
     224StylePropertySet::~StylePropertySet()
     225{
     226}
     227
     228void StylePropertySet::deref()
     229{
     230    if (derefBase()) {
     231        delete this;
     232        return;
     233    }
     234    // StylePropertySet and CSSStyleDeclaration ref each other. When we have a declaration and
     235    // our refcount drops to one we know it is the only thing keeping us alive.
     236    if (m_cssStyleDeclaration && hasOneRef())
     237        m_cssStyleDeclaration.clear();
     238}
     239
     240CSSStyleSheet* StylePropertySet::contextStyleSheet() const
    196241{
    197242    if (m_isInlineStyleDeclaration) {
     
    202247}
    203248
    204 void CSSMutableStyleDeclaration::copyPropertiesFrom(const CSSMutableStyleDeclaration& other)
     249void StylePropertySet::copyPropertiesFrom(const StylePropertySet& other)
    205250{
    206251    m_properties = other.m_properties;
    207252}
    208253
    209 String CSSMutableStyleDeclaration::getPropertyValue(int propertyID) const
     254String StylePropertySet::getPropertyValue(int propertyID) const
    210255{
    211256    RefPtr<CSSValue> value = getPropertyCSSValue(propertyID);
     
    378423}
    379424
    380 String CSSMutableStyleDeclaration::borderSpacingValue(const int properties[2]) const
     425String StylePropertySet::borderSpacingValue(const int properties[2]) const
    381426{
    382427    RefPtr<CSSValue> horizontalValue = getPropertyCSSValue(properties[0]);
     
    394439}
    395440
    396 bool CSSMutableStyleDeclaration::appendFontLonghandValueIfExplicit(int propertyId, StringBuilder& result) const
     441bool StylePropertySet::appendFontLonghandValueIfExplicit(int propertyId, StringBuilder& result) const
    397442{
    398443    const CSSProperty* property = findPropertyWithId(propertyId);
     
    425470}
    426471
    427 String CSSMutableStyleDeclaration::fontValue() const
     472String StylePropertySet::fontValue() const
    428473{
    429474    const CSSProperty* fontSizeProperty = findPropertyWithId(CSSPropertyFontSize);
     
    450495}
    451496
    452 String CSSMutableStyleDeclaration::get4Values(const int* properties) const
     497String StylePropertySet::get4Values(const int* properties) const
    453498{
    454499    // Assume the properties are in the usual order top, right, bottom, left.
     
    477522}
    478523
    479 String CSSMutableStyleDeclaration::getLayeredShorthandValue(const int* properties, size_t size) const
     524String StylePropertySet::getLayeredShorthandValue(const int* properties, size_t size) const
    480525{
    481526    String res;
     
    578623}
    579624
    580 String CSSMutableStyleDeclaration::getShorthandValue(const int* properties, size_t size) const
     625String StylePropertySet::getShorthandValue(const int* properties, size_t size) const
    581626{
    582627    String res;
     
    596641
    597642// only returns a non-null value if all properties have the same, non-null value
    598 String CSSMutableStyleDeclaration::getCommonValue(const int* properties, size_t size) const
     643String StylePropertySet::getCommonValue(const int* properties, size_t size) const
    599644{
    600645    String res;
     
    614659}
    615660
    616 PassRefPtr<CSSValue> CSSMutableStyleDeclaration::getPropertyCSSValue(int propertyID) const
     661PassRefPtr<CSSValue> StylePropertySet::getPropertyCSSValue(int propertyID) const
    617662{
    618663    const CSSProperty* property = findPropertyWithId(propertyID);
     
    620665}
    621666
    622 bool CSSMutableStyleDeclaration::removeShorthandProperty(int propertyID, bool notifyChanged)
     667bool StylePropertySet::removeShorthandProperty(int propertyID, bool notifyChanged)
    623668{
    624669    CSSPropertyLonghand longhand = longhandForProperty(propertyID);
     
    628673}
    629674
    630 String CSSMutableStyleDeclaration::removeProperty(int propertyID, bool notifyChanged, bool returnText)
     675String StylePropertySet::removeProperty(int propertyID, bool notifyChanged, bool returnText)
    631676{
    632677#if ENABLE(MUTATION_OBSERVERS)
     
    659704}
    660705
    661 void CSSMutableStyleDeclaration::setNeedsStyleRecalc()
     706void StylePropertySet::setNeedsStyleRecalc()
    662707{
    663708    if (isInlineStyleDeclaration()) {
     
    671716    }
    672717
    673     if (CSSStyleSheet* styleSheet = parentStyleSheet()) {
     718    if (CSSStyleSheet* styleSheet = contextStyleSheet()) {
    674719        if (Document* document = styleSheet->findDocument())
    675720            document->styleSelectorChanged(DeferRecalcStyle);
     
    677722}
    678723
    679 bool CSSMutableStyleDeclaration::propertyIsImportant(int propertyID) const
     724bool StylePropertySet::propertyIsImportant(int propertyID) const
    680725{
    681726    const CSSProperty* property = findPropertyWithId(propertyID);
     
    694739}
    695740
    696 int CSSMutableStyleDeclaration::getPropertyShorthand(int propertyID) const
     741int StylePropertySet::getPropertyShorthand(int propertyID) const
    697742{
    698743    const CSSProperty* property = findPropertyWithId(propertyID);
     
    700745}
    701746
    702 bool CSSMutableStyleDeclaration::isPropertyImplicit(int propertyID) const
     747bool StylePropertySet::isPropertyImplicit(int propertyID) const
    703748{
    704749    const CSSProperty* property = findPropertyWithId(propertyID);
     
    706751}
    707752
    708 bool CSSMutableStyleDeclaration::setProperty(int propertyID, const String& value, bool important, bool notifyChanged)
     753bool StylePropertySet::setProperty(int propertyID, const String& value, bool important, bool notifyChanged)
    709754{
    710755#if ENABLE(MUTATION_OBSERVERS)
     
    738783}
    739784
    740 void CSSMutableStyleDeclaration::setProperty(const CSSProperty& property, CSSProperty* slot)
     785void StylePropertySet::setProperty(const CSSProperty& property, CSSProperty* slot)
    741786{
    742787#if ENABLE(MUTATION_OBSERVERS)
     
    758803}
    759804
    760 bool CSSMutableStyleDeclaration::setProperty(int propertyID, int value, bool important, bool notifyChanged)
     805bool StylePropertySet::setProperty(int propertyID, int value, bool important, bool notifyChanged)
    761806{
    762807    CSSProperty property(propertyID, CSSPrimitiveValue::createIdentifier(value), important);
     
    767812}
    768813
    769 bool CSSMutableStyleDeclaration::setProperty(int propertyID, double value, CSSPrimitiveValue::UnitTypes unit, bool important, bool notifyChanged)
     814bool StylePropertySet::setProperty(int propertyID, double value, CSSPrimitiveValue::UnitTypes unit, bool important, bool notifyChanged)
    770815{
    771816    CSSProperty property(propertyID, CSSPrimitiveValue::create(value, unit), important);
     
    776821}
    777822
    778 void CSSMutableStyleDeclaration::parseDeclaration(const String& styleDeclaration)
     823void StylePropertySet::parseDeclaration(const String& styleDeclaration)
    779824{
    780825#if ENABLE(MUTATION_OBSERVERS)
     
    793838}
    794839
    795 void CSSMutableStyleDeclaration::addParsedProperties(const CSSProperty* const* properties, int numProperties)
     840void StylePropertySet::addParsedProperties(const CSSProperty* const* properties, int numProperties)
    796841{
    797842#if ENABLE(MUTATION_OBSERVERS)
     
    811856}
    812857
    813 void CSSMutableStyleDeclaration::addParsedProperty(const CSSProperty& property)
     858void StylePropertySet::addParsedProperty(const CSSProperty& property)
    814859{
    815860#if ENABLE(MUTATION_OBSERVERS)
     
    828873}
    829874
    830 unsigned CSSMutableStyleDeclaration::length() const
    831 {
    832     return propertyCount();
    833 }
    834 
    835 String CSSMutableStyleDeclaration::item(unsigned i) const
    836 {
    837     if (i >= m_properties.size())
    838        return "";
    839     return getPropertyName(static_cast<CSSPropertyID>(m_properties[i].id()));
    840 }
    841 
    842 String CSSMutableStyleDeclaration::asText() const
     875String StylePropertySet::asText() const
    843876{
    844877    String result = "";
     
    902935}
    903936
    904 void CSSMutableStyleDeclaration::setCssText(const String& text, ExceptionCode& ec)
    905 {
    906     ec = 0;
    907     // FIXME: Detect syntax errors and set ec.
    908     parseDeclaration(text);
    909 }
    910 
    911 void CSSMutableStyleDeclaration::merge(const CSSMutableStyleDeclaration* other, bool argOverridesOnConflict)
     937void StylePropertySet::merge(const StylePropertySet* other, bool argOverridesOnConflict)
    912938{
    913939#if ENABLE(MUTATION_OBSERVERS)
     
    935961}
    936962
    937 void CSSMutableStyleDeclaration::addSubresourceStyleURLs(ListHashSet<KURL>& urls)
    938 {
    939     CSSStyleSheet* sheet = parentStyleSheet();
     963void StylePropertySet::addSubresourceStyleURLs(ListHashSet<KURL>& urls)
     964{
     965    CSSStyleSheet* sheet = contextStyleSheet();
    940966    size_t size = m_properties.size();
    941967    for (size_t i = 0; i < size; ++i)
     
    971997const unsigned numBlockProperties = WTF_ARRAY_LENGTH(blockProperties);
    972998
    973 PassRefPtr<CSSMutableStyleDeclaration> CSSMutableStyleDeclaration::copyBlockProperties() const
     999PassRefPtr<StylePropertySet> StylePropertySet::copyBlockProperties() const
    9741000{
    9751001    return copyPropertiesInSet(blockProperties, numBlockProperties);
    9761002}
    9771003
    978 void CSSMutableStyleDeclaration::removeBlockProperties()
     1004void StylePropertySet::removeBlockProperties()
    9791005{
    9801006    removePropertiesInSet(blockProperties, numBlockProperties);
    9811007}
    9821008
    983 bool CSSMutableStyleDeclaration::removePropertiesInSet(const int* set, unsigned length, bool notifyChanged)
     1009bool StylePropertySet::removePropertiesInSet(const int* set, unsigned length, bool notifyChanged)
    9841010{
    9851011    if (m_properties.isEmpty())
     
    10221048}
    10231049
    1024 PassRefPtr<CSSMutableStyleDeclaration> CSSMutableStyleDeclaration::makeMutable()
    1025 {
    1026     return this;
    1027 }
    1028 
    1029 PassRefPtr<CSSMutableStyleDeclaration> CSSMutableStyleDeclaration::copy() const
    1030 {
    1031     return adoptRef(new CSSMutableStyleDeclaration(0, m_properties));
    1032 }
    1033 
    1034 const CSSProperty* CSSMutableStyleDeclaration::findPropertyWithId(int propertyID) const
     1050const CSSProperty* StylePropertySet::findPropertyWithId(int propertyID) const
    10351051{
    10361052    for (int n = m_properties.size() - 1 ; n >= 0; --n) {
     
    10411057}
    10421058
    1043 CSSProperty* CSSMutableStyleDeclaration::findPropertyWithId(int propertyID)
     1059CSSProperty* StylePropertySet::findPropertyWithId(int propertyID)
    10441060{
    10451061    for (int n = m_properties.size() - 1 ; n >= 0; --n) {
     
    10491065    return 0;
    10501066}
    1051 
    1052 CSSRule* CSSMutableStyleDeclaration::parentRule() const
    1053 {
    1054     return parentRuleInternal();
    1055 }
    1056 
    1057 String CSSMutableStyleDeclaration::cssText() const
    1058 {
    1059     return asText();
    1060 }
    1061 
    1062 PassRefPtr<CSSValue> CSSMutableStyleDeclaration::getPropertyCSSValue(const String& propertyName)
    1063 {
    1064     int propertyID = cssPropertyID(propertyName);
    1065     if (!propertyID)
    1066         return 0;
    1067     return getPropertyCSSValue(propertyID);
    1068 }
    1069 
    1070 String CSSMutableStyleDeclaration::getPropertyValue(const String &propertyName)
    1071 {
    1072     int propertyID = cssPropertyID(propertyName);
    1073     if (!propertyID)
    1074         return String();
    1075     return getPropertyValue(propertyID);
    1076 }
    1077 
    1078 String CSSMutableStyleDeclaration::getPropertyPriority(const String& propertyName)
    1079 {
    1080     int propertyID = cssPropertyID(propertyName);
    1081     if (!propertyID)
    1082         return String();
    1083     return propertyIsImportant(propertyID) ? "important" : "";
    1084 }
    1085 
    1086 String CSSMutableStyleDeclaration::getPropertyShorthand(const String& propertyName)
    1087 {
    1088     int propertyID = cssPropertyID(propertyName);
    1089     if (!propertyID)
    1090         return String();
    1091     int shorthandID = getPropertyShorthand(propertyID);
    1092     if (!shorthandID)
    1093         return String();
    1094     return getPropertyName(static_cast<CSSPropertyID>(shorthandID));
    1095 }
    1096 
    1097 bool CSSMutableStyleDeclaration::isPropertyImplicit(const String& propertyName)
    1098 {
    1099     int propertyID = cssPropertyID(propertyName);
    1100     if (!propertyID)
    1101         return false;
    1102     return isPropertyImplicit(propertyID);
    1103 }
    1104 
    1105 void CSSMutableStyleDeclaration::setProperty(const String& propertyName, const String& value, const String& priority, ExceptionCode& ec)
    1106 {
    1107     int propertyID = cssPropertyID(propertyName);
    1108     if (!propertyID)
    1109         return;
    1110     bool important = priority.find("important", 0, false) != notFound;
    1111     ec = 0;
    1112     setProperty(propertyID, value, important, true);
    1113 }
    1114 
    1115 String CSSMutableStyleDeclaration::removeProperty(const String& propertyName, ExceptionCode& ec)
    1116 {
    1117     int propertyID = cssPropertyID(propertyName);
    1118     if (!propertyID)
    1119         return String();
    1120     ec = 0;
    1121     return removeProperty(propertyID, true, true);
    1122 }
    1123 
    1124 PassRefPtr<CSSValue> CSSMutableStyleDeclaration::getPropertyCSSValueInternal(CSSPropertyID propertyID)
    1125 {
    1126     return getPropertyCSSValue(propertyID);
    1127 }
    1128 
    1129 String CSSMutableStyleDeclaration::getPropertyValueInternal(CSSPropertyID propertyID)
    1130 {
    1131     return getPropertyValue(propertyID);
    1132 }
    1133 
    1134 void CSSMutableStyleDeclaration::setPropertyInternal(CSSPropertyID propertyID, const String& value, bool important, ExceptionCode& ec)
    1135 {
    1136     ec = 0;
    1137     setProperty(propertyID, value, important, true);
    1138 }
    1139 
    1140 PassRefPtr<CSSMutableStyleDeclaration> CSSMutableStyleDeclaration::copyPropertiesInSet(const int* set, unsigned length) const
    1141 {
    1142     Vector<CSSProperty> list;
    1143     list.reserveInitialCapacity(length);
    1144     for (unsigned i = 0; i < length; ++i) {
    1145         RefPtr<CSSValue> value = getPropertyCSSValue(set[i]);
    1146         if (value)
    1147             list.append(CSSProperty(set[i], value.release(), false));
    1148     }
    1149     return CSSMutableStyleDeclaration::create(list);
    1150 }
    1151 
    1152 bool CSSMutableStyleDeclaration::cssPropertyMatches(const CSSProperty* property) const
     1067   
     1068bool StylePropertySet::propertyMatches(const CSSProperty* property) const
    11531069{
    11541070    RefPtr<CSSValue> value = getPropertyCSSValue(property->id());
    11551071    return value && value->cssText() == property->value()->cssText();
    11561072}
    1157 
    1158 void CSSMutableStyleDeclaration::removeEquivalentProperties(const CSSStyleDeclaration* style)
     1073   
     1074void StylePropertySet::removeEquivalentProperties(const StylePropertySet* style)
     1075{
     1076    Vector<int> propertiesToRemove;
     1077    size_t size = m_properties.size();
     1078    for (size_t i = 0; i < size; ++i) {
     1079        const CSSProperty& property = m_properties[i];
     1080        if (style->propertyMatches(&property))
     1081            propertiesToRemove.append(property.id());
     1082    }   
     1083    // FIXME: This should use mass removal.
     1084    for (unsigned i = 0; i < propertiesToRemove.size(); ++i)
     1085        removeProperty(propertiesToRemove[i]);
     1086}
     1087
     1088void StylePropertySet::removeEquivalentProperties(const CSSStyleDeclaration* style)
    11591089{
    11601090    Vector<int> propertiesToRemove;
     
    11701100}
    11711101
     1102PassRefPtr<StylePropertySet> StylePropertySet::copy() const
     1103{
     1104    return adoptRef(new StylePropertySet(0, m_properties));
     1105}
     1106
     1107PassRefPtr<StylePropertySet> StylePropertySet::copyPropertiesInSet(const int* set, unsigned length) const
     1108{
     1109    Vector<CSSProperty> list;
     1110    list.reserveInitialCapacity(length);
     1111    for (unsigned i = 0; i < length; ++i) {
     1112        RefPtr<CSSValue> value = getPropertyCSSValue(set[i]);
     1113        if (value)
     1114            list.append(CSSProperty(set[i], value.release(), false));
     1115    }
     1116    return StylePropertySet::create(list);
     1117}
     1118
     1119CSSStyleDeclaration* StylePropertySet::ensureCSSStyleDeclaration() const
     1120{
     1121    if (!m_cssStyleDeclaration)
     1122        m_cssStyleDeclaration = PropertySetCSSStyleDeclaration::create(const_cast<StylePropertySet*>(this));
     1123    return m_cssStyleDeclaration.get();
     1124}
     1125
     1126unsigned PropertySetCSSStyleDeclaration::length() const
     1127{
     1128    return m_propertySet->propertyCount();
     1129}
     1130
     1131String PropertySetCSSStyleDeclaration::item(unsigned i) const
     1132{
     1133    if (i >= m_propertySet->propertyCount())
     1134        return "";
     1135    return getPropertyName(static_cast<CSSPropertyID>(m_propertySet->propertyAt(i).id()));
     1136}
     1137
     1138CSSRule* PropertySetCSSStyleDeclaration::parentRule() const
     1139{
     1140    return m_propertySet->parentRuleInternal();
     1141}
     1142
     1143String PropertySetCSSStyleDeclaration::cssText() const
     1144{
     1145    return m_propertySet->asText();
     1146}
     1147   
     1148void PropertySetCSSStyleDeclaration::setCssText(const String& text, ExceptionCode& ec)
     1149{
     1150    ec = 0;
     1151    // FIXME: Detect syntax errors and set ec.
     1152    m_propertySet->parseDeclaration(text);
     1153}
     1154
     1155PassRefPtr<CSSValue> PropertySetCSSStyleDeclaration::getPropertyCSSValue(const String& propertyName)
     1156{
     1157    int propertyID = cssPropertyID(propertyName);
     1158    if (!propertyID)
     1159        return 0;
     1160    return m_propertySet->getPropertyCSSValue(propertyID);
     1161}
     1162
     1163String PropertySetCSSStyleDeclaration::getPropertyValue(const String &propertyName)
     1164{
     1165    int propertyID = cssPropertyID(propertyName);
     1166    if (!propertyID)
     1167        return String();
     1168    return m_propertySet->getPropertyValue(propertyID);
     1169}
     1170
     1171String PropertySetCSSStyleDeclaration::getPropertyPriority(const String& propertyName)
     1172{
     1173    int propertyID = cssPropertyID(propertyName);
     1174    if (!propertyID)
     1175        return String();
     1176    return m_propertySet->propertyIsImportant(propertyID) ? "important" : "";
     1177}
     1178
     1179String PropertySetCSSStyleDeclaration::getPropertyShorthand(const String& propertyName)
     1180{
     1181    int propertyID = cssPropertyID(propertyName);
     1182    if (!propertyID)
     1183        return String();
     1184    int shorthandID = m_propertySet->getPropertyShorthand(propertyID);
     1185    if (!shorthandID)
     1186        return String();
     1187    return getPropertyName(static_cast<CSSPropertyID>(shorthandID));
     1188}
     1189
     1190bool PropertySetCSSStyleDeclaration::isPropertyImplicit(const String& propertyName)
     1191{
     1192    int propertyID = cssPropertyID(propertyName);
     1193    if (!propertyID)
     1194        return false;
     1195    return m_propertySet->isPropertyImplicit(propertyID);
     1196}
     1197
     1198void PropertySetCSSStyleDeclaration::setProperty(const String& propertyName, const String& value, const String& priority, ExceptionCode& ec)
     1199{
     1200    int propertyID = cssPropertyID(propertyName);
     1201    if (!propertyID)
     1202        return;
     1203    bool important = priority.find("important", 0, false) != notFound;
     1204    ec = 0;
     1205    m_propertySet->setProperty(propertyID, value, important, true);
     1206}
     1207
     1208String PropertySetCSSStyleDeclaration::removeProperty(const String& propertyName, ExceptionCode& ec)
     1209{
     1210    int propertyID = cssPropertyID(propertyName);
     1211    if (!propertyID)
     1212        return String();
     1213    ec = 0;
     1214    return m_propertySet->removeProperty(propertyID, true, true);
     1215}
     1216
     1217PassRefPtr<CSSValue> PropertySetCSSStyleDeclaration::getPropertyCSSValueInternal(CSSPropertyID propertyID)
     1218{
     1219    return m_propertySet->getPropertyCSSValue(propertyID);
     1220}
     1221
     1222String PropertySetCSSStyleDeclaration::getPropertyValueInternal(CSSPropertyID propertyID)
     1223{
     1224    return m_propertySet->getPropertyValue(propertyID);
     1225}
     1226
     1227void PropertySetCSSStyleDeclaration::setPropertyInternal(CSSPropertyID propertyID, const String& value, bool important, ExceptionCode& ec)
     1228{
     1229    ec = 0;
     1230    m_propertySet->setProperty(propertyID, value, important, true);
     1231}
     1232
     1233CSSStyleSheet* PropertySetCSSStyleDeclaration::parentStyleSheet() const
     1234{
     1235    return m_propertySet->contextStyleSheet();
     1236}
     1237
     1238PassRefPtr<StylePropertySet> PropertySetCSSStyleDeclaration::copy() const
     1239{
     1240    return m_propertySet->copy();
     1241}
     1242
     1243PassRefPtr<StylePropertySet> PropertySetCSSStyleDeclaration::makeMutable()
     1244{
     1245    ASSERT(m_propertySet->m_cssStyleDeclaration == this || (!m_propertySet->m_cssStyleDeclaration && m_propertySet->hasOneRef()));
     1246    if (!m_propertySet->m_cssStyleDeclaration)
     1247        m_propertySet->m_cssStyleDeclaration = this;
     1248    return m_propertySet;
     1249}
     1250
     1251bool PropertySetCSSStyleDeclaration::cssPropertyMatches(const CSSProperty* property) const
     1252{
     1253    return m_propertySet->propertyMatches(property);
     1254}
     1255
    11721256} // namespace WebCore
  • trunk/Source/WebCore/css/CSSMutableStyleDeclaration.h

    r106568 r106681  
    3232namespace WebCore {
    3333
     34class PropertySetCSSStyleDeclaration;
    3435class StyledElement;
    3536
    36 class CSSMutableStyleDeclaration : public CSSStyleDeclaration {
     37class StylePropertySet : public WTF::RefCountedBase {
    3738public:
    38     virtual ~CSSMutableStyleDeclaration();
     39    ~StylePropertySet();
    3940
    40     static PassRefPtr<CSSMutableStyleDeclaration> create()
     41    static PassRefPtr<StylePropertySet> create()
    4142    {
    42         return adoptRef(new CSSMutableStyleDeclaration);
     43        return adoptRef(new StylePropertySet);
    4344    }
    44     static PassRefPtr<CSSMutableStyleDeclaration> create(CSSRule* parentRule)
     45    static PassRefPtr<StylePropertySet> create(CSSRule* parentRule)
    4546    {
    46         return adoptRef(new CSSMutableStyleDeclaration(parentRule));
     47        return adoptRef(new StylePropertySet(parentRule));
    4748    }
    48     static PassRefPtr<CSSMutableStyleDeclaration> create(CSSRule* parentRule, const CSSProperty* const* properties, int numProperties)
     49    static PassRefPtr<StylePropertySet> create(CSSRule* parentRule, const CSSProperty* const* properties, int numProperties)
    4950    {
    50         return adoptRef(new CSSMutableStyleDeclaration(parentRule, properties, numProperties));
     51        return adoptRef(new StylePropertySet(parentRule, properties, numProperties));
    5152    }
    52     static PassRefPtr<CSSMutableStyleDeclaration> create(const Vector<CSSProperty>& properties)
     53    static PassRefPtr<StylePropertySet> create(const Vector<CSSProperty>& properties)
    5354    {
    54         return adoptRef(new CSSMutableStyleDeclaration(0, properties));
     55        return adoptRef(new StylePropertySet(0, properties));
    5556    }
    56     static PassRefPtr<CSSMutableStyleDeclaration> createInline(StyledElement* element)
     57    static PassRefPtr<StylePropertySet> createInline(StyledElement* element)
    5758    {
    58         return adoptRef(new CSSMutableStyleDeclaration(element));
     59        return adoptRef(new StylePropertySet(element));
    5960    }
     61
     62    void deref();
    6063
    6164    unsigned propertyCount() const { return m_properties.size(); }
     
    6871    int getPropertyShorthand(int propertyID) const;
    6972    bool isPropertyImplicit(int propertyID) const;
    70 
    71     virtual PassRefPtr<CSSMutableStyleDeclaration> copy() const;
    7273
    7374    bool setProperty(int propertyID, int value, bool important = false) { return setProperty(propertyID, value, important, true); }
     
    8889    void addParsedProperty(const CSSProperty&);
    8990
    90     PassRefPtr<CSSMutableStyleDeclaration> copyBlockProperties() const;
     91    PassRefPtr<StylePropertySet> copyBlockProperties() const;
    9192    void removeBlockProperties();
    9293    void removePropertiesInSet(const int* set, unsigned length) { removePropertiesInSet(set, length, true); }
    9394
    94     void merge(const CSSMutableStyleDeclaration*, bool argOverridesOnConflict = true);
     95    void merge(const StylePropertySet*, bool argOverridesOnConflict = true);
    9596
    9697    void setStrictParsing(bool b) { m_strictParsing = b; }
     
    100101    void addSubresourceStyleURLs(ListHashSet<KURL>&);
    101102
     103    PassRefPtr<StylePropertySet> copy() const;
    102104    // Used by StyledElement::copyNonAttributeProperties().
    103     void copyPropertiesFrom(const CSSMutableStyleDeclaration&);
     105    void copyPropertiesFrom(const StylePropertySet&);
    104106
     107    void removeEquivalentProperties(const StylePropertySet*);
    105108    void removeEquivalentProperties(const CSSStyleDeclaration*);
    106109
    107     PassRefPtr<CSSMutableStyleDeclaration> copyPropertiesInSet(const int* set, unsigned length) const;
     110    PassRefPtr<StylePropertySet> copyPropertiesInSet(const int* set, unsigned length) const;
    108111
    109112    CSSRule* parentRuleInternal() const { return m_isInlineStyleDeclaration ? 0 : m_parent.rule; }
     
    116119   
    117120    String asText() const;
     121   
     122    CSSStyleDeclaration* ensureCSSStyleDeclaration() const;
    118123
    119124private:
    120     CSSMutableStyleDeclaration();
    121     CSSMutableStyleDeclaration(CSSRule* parentRule);
    122     CSSMutableStyleDeclaration(CSSRule* parentRule, const Vector<CSSProperty>&);
    123     CSSMutableStyleDeclaration(CSSRule* parentRule, const CSSProperty* const *, int numProperties);
    124     CSSMutableStyleDeclaration(StyledElement*);
    125 
    126     virtual PassRefPtr<CSSMutableStyleDeclaration> makeMutable();
    127 
    128     // CSSOM functions. Don't make these public.
    129     virtual CSSRule* parentRule() const;
    130     virtual unsigned length() const;
    131     virtual String item(unsigned index) const;
    132     virtual PassRefPtr<CSSValue> getPropertyCSSValue(const String& propertyName);
    133     virtual String getPropertyValue(const String& propertyName);
    134     virtual String getPropertyPriority(const String& propertyName);
    135     virtual String getPropertyShorthand(const String& propertyName);
    136     virtual bool isPropertyImplicit(const String& propertyName);
    137     virtual void setProperty(const String& propertyName, const String& value, const String& priority, ExceptionCode&);
    138     virtual String removeProperty(const String& propertyName, ExceptionCode&);
    139     virtual String cssText() const;
    140     virtual void setCssText(const String&, ExceptionCode&);
    141     virtual PassRefPtr<CSSValue> getPropertyCSSValueInternal(CSSPropertyID);
    142     virtual String getPropertyValueInternal(CSSPropertyID);
    143     virtual void setPropertyInternal(CSSPropertyID, const String& value, bool important, ExceptionCode&);
     125    StylePropertySet();
     126    StylePropertySet(CSSRule* parentRule);
     127    StylePropertySet(CSSRule* parentRule, const Vector<CSSProperty>&);
     128    StylePropertySet(CSSRule* parentRule, const CSSProperty* const *, int numProperties);
     129    StylePropertySet(StyledElement*);
    144130
    145131    void setNeedsStyleRecalc();
     
    162148    bool removeShorthandProperty(int propertyID, bool notifyChanged);
    163149    bool removePropertiesInSet(const int* set, unsigned length, bool notifyChanged);
    164 
    165     virtual bool cssPropertyMatches(const CSSProperty*) const;
    166     virtual CSSStyleSheet* parentStyleSheet() const { return contextStyleSheet(); }
     150    bool propertyMatches(const CSSProperty*) const;
    167151
    168152    const CSSProperty* findPropertyWithId(int propertyId) const;
     
    179163        CSSRule* rule;
    180164        StyledElement* element;
    181     } m_parent;   
     165    } m_parent;
     166   
     167    mutable RefPtr<PropertySetCSSStyleDeclaration> m_cssStyleDeclaration;
     168   
     169    friend class PropertySetCSSStyleDeclaration;
    182170};
    183171
  • trunk/Source/WebCore/css/CSSPageRule.h

    r99708 r106681  
    2929namespace WebCore {
    3030
    31 class CSSMutableStyleDeclaration;
    3231class CSSSelector;
    3332class CSSSelectorList;
  • trunk/Source/WebCore/css/CSSParser.cpp

    r106568 r106681  
    327327}
    328328
    329 static bool parseColorValue(CSSMutableStyleDeclaration* declaration, int propertyId, const String& string, bool important, bool strict, CSSStyleSheet* contextStyleSheet = 0)
     329static bool parseColorValue(StylePropertySet* declaration, int propertyId, const String& string, bool important, bool strict, CSSStyleSheet* contextStyleSheet = 0)
    330330{
    331331    if (!string.length())
     
    410410}
    411411
    412 static bool parseSimpleLengthValue(CSSMutableStyleDeclaration* declaration, int propertyId, const String& string, bool important, bool strict, CSSStyleSheet* contextStyleSheet = 0)
     412static bool parseSimpleLengthValue(StylePropertySet* declaration, int propertyId, const String& string, bool important, bool strict, CSSStyleSheet* contextStyleSheet = 0)
    413413{
    414414    bool acceptsNegativeNumbers;
     
    499499}
    500500
    501 bool CSSParser::parseValue(CSSMutableStyleDeclaration* declaration, int propertyId, const String& string, bool important, bool strict)
     501bool CSSParser::parseValue(StylePropertySet* declaration, int propertyId, const String& string, bool important, bool strict)
    502502{
    503503    if (parseSimpleLengthValue(declaration, propertyId, string, important, strict))
     
    509509}
    510510
    511 bool CSSParser::parseValue(CSSMutableStyleDeclaration* declaration, int propertyId, const String& string, bool important, CSSStyleSheet* contextStyleSheet)
     511bool CSSParser::parseValue(StylePropertySet* declaration, int propertyId, const String& string, bool important, CSSStyleSheet* contextStyleSheet)
    512512{
    513513    if (contextStyleSheet)
     
    609609}
    610610
    611 bool CSSParser::parseDeclaration(CSSMutableStyleDeclaration* declaration, const String& string, RefPtr<CSSStyleSourceData>* styleSourceData, CSSStyleSheet* contextStyleSheet)
     611bool CSSParser::parseDeclaration(StylePropertySet* declaration, const String& string, RefPtr<CSSStyleSourceData>* styleSourceData, CSSStyleSheet* contextStyleSheet)
    612612{
    613613    // Length of the "@-webkit-decls{" prefix.
     
    88488848        if (m_hasFontFaceOnlyValues)
    88498849            deleteFontFaceOnlyValues();
    8850         rule->setDeclaration(CSSMutableStyleDeclaration::create(rule.get(), m_parsedProperties, m_numParsedProperties));
     8850        rule->setDeclaration(StylePropertySet::create(rule.get(), m_parsedProperties, m_numParsedProperties));
    88518851        result = rule.get();
    88528852        m_parsedRules.append(rule.release());
     
    88878887    }
    88888888    RefPtr<CSSFontFaceRule> rule = CSSFontFaceRule::create(m_styleSheet);
    8889     rule->setDeclaration(CSSMutableStyleDeclaration::create(rule.get(), m_parsedProperties, m_numParsedProperties));
     8889    rule->setDeclaration(StylePropertySet::create(rule.get(), m_parsedProperties, m_numParsedProperties));
    88908890    clearProperties();
    88918891    CSSFontFaceRule* result = rule.get();
     
    89588958        selectorVector.append(pageSelector);
    89598959        rule->adoptSelectorVector(selectorVector);
    8960         rule->setDeclaration(CSSMutableStyleDeclaration::create(rule.get(), m_parsedProperties, m_numParsedProperties));
     8960        rule->setDeclaration(StylePropertySet::create(rule.get(), m_parsedProperties, m_numParsedProperties));
    89618961        pageRule = rule.get();
    89628962        m_parsedRules.append(rule.release());
     
    90429042    RefPtr<WebKitCSSKeyframeRule> keyframe = WebKitCSSKeyframeRule::create(m_styleSheet);
    90439043    keyframe->setKeyText(keyString);
    9044     keyframe->setDeclaration(CSSMutableStyleDeclaration::create(keyframe.get(), m_parsedProperties, m_numParsedProperties));
     9044    keyframe->setDeclaration(StylePropertySet::create(keyframe.get(), m_parsedProperties, m_numParsedProperties));
    90459045
    90469046    clearProperties();
  • trunk/Source/WebCore/css/CSSParser.h

    r106217 r106681  
    4545class CSSBorderImageSliceValue;
    4646class CSSMappedAttributeDeclaration;
    47 class CSSMutableStyleDeclaration;
    4847class CSSPrimitiveValue;
    4948class CSSValuePool;
     
    5958class MediaList;
    6059class MediaQueryExp;
     60class StylePropertySet;
    6161class StyledElement;
    6262class WebKitCSSKeyframeRule;
     
    7171    PassRefPtr<CSSRule> parseRule(CSSStyleSheet*, const String&);
    7272    PassRefPtr<WebKitCSSKeyframeRule> parseKeyframeRule(CSSStyleSheet*, const String&);
    73     static bool parseValue(CSSMutableStyleDeclaration*, int propId, const String&, bool important, bool strict);
     73    static bool parseValue(StylePropertySet*, int propId, const String&, bool important, bool strict);
    7474    static bool parseColor(RGBA32& color, const String&, bool strict = false);
    7575    static bool parseSystemColor(RGBA32& color, const String&, Document*);
    7676    PassRefPtr<CSSPrimitiveValue> parseValidPrimitive(int propId, CSSParserValue*);
    77     bool parseDeclaration(CSSMutableStyleDeclaration*, const String&, RefPtr<CSSStyleSourceData>* = 0, CSSStyleSheet* contextStyleSheet = 0);
     77    bool parseDeclaration(StylePropertySet*, const String&, RefPtr<CSSStyleSourceData>* = 0, CSSStyleSheet* contextStyleSheet = 0);
    7878    bool parseMediaQuery(MediaList*, const String&);
    7979
     
    359359    bool parseGeneratedImage(CSSParserValueList*, RefPtr<CSSValue>&);
    360360
    361     bool parseValue(CSSMutableStyleDeclaration*, int propId, const String&, bool important, CSSStyleSheet* contextStyleSheet = 0);
     361    bool parseValue(StylePropertySet*, int propId, const String&, bool important, CSSStyleSheet* contextStyleSheet = 0);
    362362
    363363    enum SizeParameterType {
  • trunk/Source/WebCore/css/CSSStyleDeclaration.h

    r106568 r106681  
    2828namespace WebCore {
    2929
    30 class CSSMutableStyleDeclaration;
    3130class CSSProperty;
    3231class CSSStyleSheet;
    3332class CSSValue;
     33class StylePropertySet;
    3434class StyledElement;
    3535
     
    6060    virtual void setPropertyInternal(CSSPropertyID, const String& value, bool important, ExceptionCode&) = 0;
    6161
    62     virtual PassRefPtr<CSSMutableStyleDeclaration> copy() const = 0;
    63     virtual PassRefPtr<CSSMutableStyleDeclaration> makeMutable() = 0;
     62    virtual PassRefPtr<StylePropertySet> copy() const = 0;
     63    virtual PassRefPtr<StylePropertySet> makeMutable() = 0;
    6464
    6565    virtual bool cssPropertyMatches(const CSSProperty*) const = 0;
  • trunk/Source/WebCore/css/CSSStyleRule.h

    r106568 r106681  
    4444    void setSelectorText(const String&);
    4545
    46     CSSStyleDeclaration* style() const { return m_style.get(); }
     46    CSSStyleDeclaration* style() const { return m_style->ensureCSSStyleDeclaration(); }
    4747
    4848    String cssText() const;
    4949
    5050    void adoptSelectorVector(Vector<OwnPtr<CSSParserSelector> >& selectors) { m_selectorList.adoptSelectorVector(selectors); }
    51     void setDeclaration(PassRefPtr<CSSMutableStyleDeclaration> style) { ASSERT(style->parentRuleInternal() == this); m_style = style; }
     51    void setDeclaration(PassRefPtr<StylePropertySet> style) { ASSERT(style->parentRuleInternal() == this); m_style = style; }
    5252
    5353    const CSSSelectorList& selectorList() const { return m_selectorList; }
    54     CSSMutableStyleDeclaration* declaration() const { return m_style.get(); }
     54    StylePropertySet* declaration() const { return m_style.get(); }
    5555
    5656    void addSubresourceStyleURLs(ListHashSet<KURL>& urls);
     
    6565    String generateSelectorText() const;
    6666
    67     RefPtr<CSSMutableStyleDeclaration> m_style;
     67    RefPtr<StylePropertySet> m_style;
    6868    CSSSelectorList m_selectorList;
    6969};
  • trunk/Source/WebCore/css/CSSStyleSelector.cpp

    r106632 r106681  
    298298}
    299299
    300 static CSSMutableStyleDeclaration* leftToRightDeclaration()
    301 {
    302     DEFINE_STATIC_LOCAL(RefPtr<CSSMutableStyleDeclaration>, leftToRightDecl, (CSSMutableStyleDeclaration::create()));
     300static StylePropertySet* leftToRightDeclaration()
     301{
     302    DEFINE_STATIC_LOCAL(RefPtr<StylePropertySet>, leftToRightDecl, (StylePropertySet::create()));
    303303    if (leftToRightDecl->isEmpty())
    304304        leftToRightDecl->setProperty(CSSPropertyDirection, CSSValueLtr);
     
    306306}
    307307
    308 static CSSMutableStyleDeclaration* rightToLeftDeclaration()
    309 {
    310     DEFINE_STATIC_LOCAL(RefPtr<CSSMutableStyleDeclaration>, rightToLeftDecl, (CSSMutableStyleDeclaration::create()));
     308static StylePropertySet* rightToLeftDeclaration()
     309{
     310    DEFINE_STATIC_LOCAL(RefPtr<StylePropertySet>, rightToLeftDecl, (StylePropertySet::create()));
    311311    if (rightToLeftDecl->isEmpty())
    312312        rightToLeftDecl->setProperty(CSSPropertyDirection, CSSValueRtl);
     
    748748}
    749749
    750 void CSSStyleSelector::addMatchedDeclaration(CSSMutableStyleDeclaration* styleDeclaration, unsigned linkMatchType)
     750void CSSStyleSelector::addMatchedDeclaration(StylePropertySet* styleDeclaration, unsigned linkMatchType)
    751751{
    752752    m_matchedDecls.grow(m_matchedDecls.size() + 1);
     
    941941            }
    942942            // If the rule has no properties to apply, then ignore it in the non-debug mode.
    943             CSSMutableStyleDeclaration* decl = rule->declaration();
     943            StylePropertySet* decl = rule->declaration();
    944944            if (!decl || (decl->isEmpty() && !includeEmptyRules)) {
    945945                InspectorInstrumentation::didMatchRule(cookie, false);
     
    10141014        // Tables and table cells share an additional mapped rule that must be applied
    10151015        // after all attributes, since their mapped style depends on the values of multiple attributes.
    1016         if (RefPtr<CSSMutableStyleDeclaration> additionalStyle = m_styledElement->additionalAttributeStyle()) {
     1016        if (RefPtr<StylePropertySet> additionalStyle = m_styledElement->additionalAttributeStyle()) {
    10171017            if (result.ranges.firstAuthorRule == -1)
    10181018                result.ranges.firstAuthorRule = m_matchedDecls.size();
     
    10361036    // Now check our inline style attribute.
    10371037    if (m_matchAuthorAndUserStyles && m_styledElement) {
    1038         CSSMutableStyleDeclaration* inlineDecl = m_styledElement->inlineStyleDecl();
     1038        StylePropertySet* inlineDecl = m_styledElement->inlineStyleDecl();
    10391039        if (inlineDecl) {
    10401040            result.ranges.lastAuthorRule = m_matchedDecls.size();
     
    15311531PassRefPtr<RenderStyle> CSSStyleSelector::styleForKeyframe(const RenderStyle* elementStyle, const WebKitCSSKeyframeRule* keyframeRule, KeyframeValue& keyframe)
    15321532{
    1533     if (keyframeRule->style())
     1533    if (keyframeRule->declaration())
    15341534        addMatchedDeclaration(keyframeRule->declaration());
    15351535
     
    15711571
    15721572    // Add all the animating properties to the keyframe.
    1573     if (CSSMutableStyleDeclaration* styleDeclaration = keyframeRule->declaration()) {
     1573    if (StylePropertySet* styleDeclaration = keyframeRule->declaration()) {
    15741574        unsigned propertyCount = styleDeclaration->propertyCount();
    15751575        for (unsigned i = 0; i < propertyCount; ++i) {
     
    24362436}
    24372437
    2438 static inline bool isInsideRegionRule(CSSMutableStyleDeclaration* styleDeclaration)
     2438static inline bool isInsideRegionRule(StylePropertySet* styleDeclaration)
    24392439{
    24402440    ASSERT(styleDeclaration);
     
    24502450
    24512451template <bool applyFirst>
    2452 void CSSStyleSelector::applyDeclaration(CSSMutableStyleDeclaration* styleDeclaration, bool isImportant, bool inheritedOnly)
     2452void CSSStyleSelector::applyDeclaration(StylePropertySet* styleDeclaration, bool isImportant, bool inheritedOnly)
    24532453{
    24542454    InspectorInstrumentationCookie cookie = InspectorInstrumentation::willProcessRule(document(), styleDeclaration->parentRuleInternal());
     
    25022502    if (m_style->insideLink() != NotInsideLink) {
    25032503        for (int i = startIndex; i <= endIndex; ++i) {
    2504             CSSMutableStyleDeclaration* styleDeclaration = m_matchedDecls[i].styleDeclaration.get();
     2504            StylePropertySet* styleDeclaration = m_matchedDecls[i].styleDeclaration.get();
    25052505            unsigned linkMatchType = m_matchedDecls[i].linkMatchType;
    25062506            // FIXME: It would be nicer to pass these as arguments but that requires changes in many places.
     
    27212721
    27222722        // If the rule has no properties to apply, then ignore it.
    2723         CSSMutableStyleDeclaration* decl = rule->declaration();
     2723        StylePropertySet* decl = rule->declaration();
    27242724        if (!decl || decl->isEmpty())
    27252725            continue;
  • trunk/Source/WebCore/css/CSSStyleSelector.h

    r106351 r106681  
    3939
    4040class CSSFontSelector;
    41 class CSSMutableStyleDeclaration;
    4241class CSSPageRule;
    4342class CSSPrimitiveValue;
     
    7170class StyleImage;
    7271class StylePendingImage;
     72class StylePropertySet;
    7373class StyleShader;
    7474class StyleSheet;
     
    260260
    261261    void addMatchedRule(const RuleData* rule) { m_matchedRules.append(rule); }
    262     void addMatchedDeclaration(CSSMutableStyleDeclaration*, unsigned linkMatchType = SelectorChecker::MatchAll);
     262    void addMatchedDeclaration(StylePropertySet*, unsigned linkMatchType = SelectorChecker::MatchAll);
    263263
    264264    struct MatchRanges {
     
    295295    void applyDeclarations(bool important, int startIndex, int endIndex, bool inheritedOnly);
    296296    template <bool firstPass>
    297     void applyDeclaration(CSSMutableStyleDeclaration*, bool isImportant, bool inheritedOnly);
     297    void applyDeclaration(StylePropertySet*, bool isImportant, bool inheritedOnly);
    298298
    299299    static bool isValidRegionStyleProperty(int id);
     
    376376        MatchedStyleDeclaration() : possiblyPaddedMember(0) { }
    377377
    378         RefPtr<CSSMutableStyleDeclaration> styleDeclaration;
     378        RefPtr<StylePropertySet> styleDeclaration;
    379379        union {
    380380            unsigned linkMatchType;
  • trunk/Source/WebCore/css/WebKitCSSKeyframeRule.cpp

    r106568 r106681  
    5353}
    5454
    55 void WebKitCSSKeyframeRule::setDeclaration(PassRefPtr<CSSMutableStyleDeclaration> style)
     55void WebKitCSSKeyframeRule::setDeclaration(PassRefPtr<StylePropertySet> style)
    5656{
    5757    ASSERT(style->parentRuleInternal() == this);
  • trunk/Source/WebCore/css/WebKitCSSKeyframeRule.h

    r106393 r106681  
    5454    void getKeys(Vector<float>& keys) const   { parseKeyString(m_key, keys); }
    5555
    56     CSSStyleDeclaration* style() const { return m_style.get(); }
     56    CSSStyleDeclaration* style() const { return m_style ? m_style->ensureCSSStyleDeclaration() : 0; }
    5757
    5858    String cssText() const;
    5959
    60     CSSMutableStyleDeclaration* declaration() const { return m_style.get(); }
    61     void setDeclaration(PassRefPtr<CSSMutableStyleDeclaration>);
     60    StylePropertySet* declaration() const { return m_style.get(); }
     61    void setDeclaration(PassRefPtr<StylePropertySet>);
    6262
    6363private:
     
    6666    WebKitCSSKeyframeRule(CSSStyleSheet* parent);
    6767
    68     RefPtr<CSSMutableStyleDeclaration> m_style;
     68    RefPtr<StylePropertySet> m_style;
    6969    String m_key;        // comma separated list of keys
    7070};
  • trunk/Source/WebCore/css/WebKitCSSMatrix.cpp

    r97854 r106681  
    5353void WebKitCSSMatrix::setMatrixValue(const String& string, ExceptionCode& ec)
    5454{
    55     RefPtr<CSSMutableStyleDeclaration> styleDeclaration = CSSMutableStyleDeclaration::create();
     55    RefPtr<StylePropertySet> styleDeclaration = StylePropertySet::create();
    5656    if (CSSParser::parseValue(styleDeclaration.get(), CSSPropertyWebkitTransform, string, true, true)) {
    5757        // Convert to TransformOperations. This can fail if a property
  • trunk/Source/WebCore/dom/Attr.h

    r105739 r106681  
    5757
    5858    // An extension to get presentational information for attributes.
    59     CSSStyleDeclaration* style() { return m_attribute->decl(); }
     59    CSSStyleDeclaration* style() { return m_attribute->decl()->ensureCSSStyleDeclaration(); }
    6060
    6161    void setSpecified(bool specified) { m_specified = specified; }
  • trunk/Source/WebCore/dom/Attribute.h

    r106471 r106681  
    7070    PassRefPtr<Attribute> clone() const;
    7171   
    72     CSSMutableStyleDeclaration* decl() const { return m_mappedAttributeDeclaration ? m_mappedAttributeDeclaration->declaration() : 0; }
     72    StylePropertySet* decl() const { return m_mappedAttributeDeclaration ? m_mappedAttributeDeclaration->declaration() : 0; }
    7373
    7474    CSSMappedAttributeDeclaration* mappedAttributeDeclaration() const { return m_mappedAttributeDeclaration.get(); }
  • trunk/Source/WebCore/dom/CSSMappedAttributeDeclaration.h

    r106471 r106681  
    5959    void removeMappedProperty(StyledElement*, int propertyId);
    6060   
    61     CSSMutableStyleDeclaration* declaration() const { return m_declaration.get(); }
     61    StylePropertySet* declaration() const { return m_declaration.get(); }
    6262
    6363private:
    6464    CSSMappedAttributeDeclaration()
    65         : m_declaration(CSSMutableStyleDeclaration::create())
     65        : m_declaration(StylePropertySet::create())
    6666        , m_entryType(eNone)
    6767        , m_attrName(anyQName())
     
    7171    void setNeedsStyleRecalc(StyledElement*);
    7272
    73     RefPtr<CSSMutableStyleDeclaration> m_declaration;
     73    RefPtr<StylePropertySet> m_declaration;
    7474    MappedAttributeEntry m_entryType;
    7575    QualifiedName m_attrName;
  • trunk/Source/WebCore/dom/Document.cpp

    r106632 r106681  
    812812PassRefPtr<CSSStyleDeclaration> Document::createCSSStyleDeclaration()
    813813{
    814     return CSSMutableStyleDeclaration::create();
     814    return StylePropertySet::create()->ensureCSSStyleDeclaration();
    815815}
    816816
  • trunk/Source/WebCore/dom/ElementAttributeData.h

    r106435 r106681  
    5050    }
    5151
    52     RefPtr<CSSMutableStyleDeclaration> m_inlineStyleDecl;
     52    RefPtr<StylePropertySet> m_inlineStyleDecl;
    5353    SpaceSplitString m_classNames;
    5454    AtomicString m_idForStyleResolution;
  • trunk/Source/WebCore/dom/NamedNodeMap.cpp

    r106515 r106681  
    322322}
    323323
    324 CSSMutableStyleDeclaration* NamedNodeMap::ensureInlineStyleDecl()
     324StylePropertySet* NamedNodeMap::ensureInlineStyleDecl()
    325325{
    326326    if (!attributeData()->m_inlineStyleDecl) {
    327327        ASSERT(m_element->isStyledElement());
    328         attributeData()->m_inlineStyleDecl = CSSMutableStyleDeclaration::createInline(static_cast<StyledElement*>(m_element));
     328        attributeData()->m_inlineStyleDecl = StylePropertySet::createInline(static_cast<StyledElement*>(m_element));
    329329        attributeData()->m_inlineStyleDecl->setStrictParsing(m_element->isHTMLElement() && !m_element->document()->inQuirksMode());
    330330    }
  • trunk/Source/WebCore/dom/NamedNodeMap.h

    r106435 r106681  
    100100    const ElementAttributeData* attributeData() const { return &m_attributeData; }
    101101
    102     CSSMutableStyleDeclaration* inlineStyleDecl() { return attributeData()->m_inlineStyleDecl.get(); }
    103     CSSMutableStyleDeclaration* ensureInlineStyleDecl();
     102    StylePropertySet* inlineStyleDecl() { return attributeData()->m_inlineStyleDecl.get(); }
     103    StylePropertySet* ensureInlineStyleDecl();
    104104    void destroyInlineStyleDecl();
    105105
  • trunk/Source/WebCore/dom/StyledElement.cpp

    r106471 r106681  
    113113    setIsStyleAttributeValid();
    114114    setIsSynchronizingStyleAttribute();
    115     if (CSSMutableStyleDeclaration* inlineStyle = inlineStyleDecl())
     115    if (StylePropertySet* inlineStyle = inlineStyleDecl())
    116116        const_cast<StyledElement*>(this)->setAttribute(styleAttr, inlineStyle->asText());
    117117    clearIsSynchronizingStyleAttribute();
     
    406406        return;
    407407
    408     CSSMutableStyleDeclaration* inlineStyle = ensureInlineStyleDecl();
     408    StylePropertySet* inlineStyle = ensureInlineStyleDecl();
    409409    inlineStyle->copyPropertiesFrom(*source->inlineStyleDecl());
    410410    inlineStyle->setStrictParsing(source->inlineStyleDecl()->useStrictParsing());
     
    418418void StyledElement::addSubresourceAttributeURLs(ListHashSet<KURL>& urls) const
    419419{
    420     if (CSSMutableStyleDeclaration* inlineStyle = inlineStyleDecl())
     420    if (StylePropertySet* inlineStyle = inlineStyleDecl())
    421421        inlineStyle->addSubresourceStyleURLs(urls);
    422422}
  • trunk/Source/WebCore/dom/StyledElement.h

    r106435 r106681  
    5656    static void setMappedAttributeDecl(MappedAttributeEntry, Attribute*, CSSMappedAttributeDeclaration*);
    5757
    58     virtual PassRefPtr<CSSMutableStyleDeclaration> additionalAttributeStyle() { return 0; }
     58    virtual PassRefPtr<StylePropertySet> additionalAttributeStyle() { return 0; }
    5959    void invalidateStyleAttribute();
    6060
    61     CSSMutableStyleDeclaration* inlineStyleDecl() const { return attributeMap() ? attributeMap()->inlineStyleDecl() : 0; }
    62     CSSMutableStyleDeclaration* ensureInlineStyleDecl() { return ensureAttributeMap()->ensureInlineStyleDecl(); }
    63     virtual CSSStyleDeclaration* style() OVERRIDE { return ensureInlineStyleDecl(); }
     61    StylePropertySet* inlineStyleDecl() const { return attributeMap() ? attributeMap()->inlineStyleDecl() : 0; }
     62    StylePropertySet* ensureInlineStyleDecl() { return ensureAttributeMap()->ensureInlineStyleDecl(); }
     63    virtual CSSStyleDeclaration* style() OVERRIDE { return ensureInlineStyleDecl()->ensureCSSStyleDeclaration(); }
    6464
    6565    const SpaceSplitString& classNames() const;
  • trunk/Source/WebCore/editing/ApplyStyleCommand.cpp

    r106515 r106681  
    385385        lastStyledNode = node;
    386386
    387         CSSMutableStyleDeclaration* inlineStyleDecl = element->ensureInlineStyleDecl();
     387        StylePropertySet* inlineStyleDecl = element->ensureInlineStyleDecl();
    388388        float currentFontSize = computedFontSize(node);
    389389        float desiredFontSize = max(MinimumFontSize, startingFontSizes.get(node) + style->fontSizeDelta());
     
    512512            removeNodeAttribute(element, dirAttr);
    513513        } else {
    514             RefPtr<CSSMutableStyleDeclaration> inlineStyle = element->ensureInlineStyleDecl()->copy();
     514            RefPtr<StylePropertySet> inlineStyle = element->ensureInlineStyleDecl()->copy();
    515515            inlineStyle->setProperty(CSSPropertyUnicodeBidi, CSSValueNormal);
    516516            inlineStyle->removeProperty(CSSPropertyDirection);
     
    726726            // Add to this element's inline style and skip over its contents.
    727727            HTMLElement* element = toHTMLElement(node);
    728             RefPtr<CSSMutableStyleDeclaration> inlineStyle = element->ensureInlineStyleDecl()->copy();
     728            RefPtr<StylePropertySet> inlineStyle = element->ensureInlineStyleDecl()->copy();
    729729            inlineStyle->merge(style->style());
    730730            setNodeAttribute(element, styleAttr, inlineStyle->asText());
     
    891891        return false;
    892892
    893     CSSMutableStyleDeclaration* inlineStyle = element->inlineStyleDecl();
     893    StylePropertySet* inlineStyle = element->inlineStyleDecl();
    894894    ASSERT(inlineStyle);
    895895    // FIXME: We should use a mass-removal function here but we don't have an undoable one yet.
     
    13111311       
    13121312    String cssText = styleChange.cssStyle();
    1313     if (CSSMutableStyleDeclaration* decl = block->inlineStyleDecl())
     1313    if (StylePropertySet* decl = block->inlineStyleDecl())
    13141314        cssText += decl->asText();
    13151315    setNodeAttribute(block, styleAttr, cssText);
     
    13761376    if (styleChange.cssStyle().length()) {
    13771377        if (styleContainer) {
    1378             if (CSSMutableStyleDeclaration* existingStyle = styleContainer->inlineStyleDecl())
     1378            if (StylePropertySet* existingStyle = styleContainer->inlineStyleDecl())
    13791379                setNodeAttribute(styleContainer, styleAttr, existingStyle->asText() + styleChange.cssStyle());
    13801380            else
  • trunk/Source/WebCore/editing/DeleteButtonController.cpp

    r105642 r106681  
    206206    container->setIdAttribute(containerElementIdentifier);
    207207
    208     CSSMutableStyleDeclaration* style = container->ensureInlineStyleDecl();
     208    StylePropertySet* style = container->ensureInlineStyleDecl();
    209209    style->setProperty(CSSPropertyWebkitUserDrag, CSSValueNone);
    210210    style->setProperty(CSSPropertyWebkitUserSelect, CSSValueNone);
  • trunk/Source/WebCore/editing/EditingStyle.cpp

    r106490 r106681  
    8484
    8585template <class StyleDeclarationType>
    86 static PassRefPtr<CSSMutableStyleDeclaration> copyEditingProperties(StyleDeclarationType* style, EditingPropertiesType type = OnlyInheritableEditingProperties)
     86static PassRefPtr<StylePropertySet> copyEditingProperties(StyleDeclarationType* style, EditingPropertiesType type = OnlyInheritableEditingProperties)
    8787{
    8888    if (type == AllEditingProperties)
     
    100100}
    101101
    102 static PassRefPtr<CSSMutableStyleDeclaration> editingStyleFromComputedStyle(PassRefPtr<CSSComputedStyleDeclaration> style, EditingPropertiesType type = OnlyInheritableEditingProperties)
     102static PassRefPtr<StylePropertySet> editingStyleFromComputedStyle(PassRefPtr<CSSComputedStyleDeclaration> style, EditingPropertiesType type = OnlyInheritableEditingProperties)
    103103{
    104104    if (!style)
    105         return CSSMutableStyleDeclaration::create();
     105        return StylePropertySet::create();
    106106    return copyEditingProperties(style.get(), type);
    107107}
    108108
    109 static RefPtr<CSSMutableStyleDeclaration> getPropertiesNotIn(CSSStyleDeclaration* styleWithRedundantProperties, CSSStyleDeclaration* baseStyle);
     109static PassRefPtr<StylePropertySet> getPropertiesNotIn(StylePropertySet* styleWithRedundantProperties, CSSStyleDeclaration* baseStyle);
    110110enum LegacyFontSizeMode { AlwaysUseLegacyFontSize, UseLegacyFontSizeOnlyIfPixelValuesMatch };
    111111static int legacyFontSizeFromCSSValue(Document*, CSSPrimitiveValue*, bool shouldUseFixedFontDefaultSize, LegacyFontSizeMode);
     112static bool isTransparentColorValue(CSSValue*);
    112113static bool hasTransparentBackgroundColor(CSSStyleDeclaration*);
     114static bool hasTransparentBackgroundColor(StylePropertySet*);
    113115static PassRefPtr<CSSValue> backgroundColorInEffect(Node*);
    114116
     
    123125    virtual bool matches(const Element* element) const { return !m_tagName || element->hasTagName(*m_tagName); }
    124126    virtual bool hasAttribute() const { return false; }
    125     virtual bool propertyExistsInStyle(CSSMutableStyleDeclaration* style) const { return style && style->getPropertyCSSValue(m_propertyID); }
    126     virtual bool valueIsPresentInStyle(Element*, CSSMutableStyleDeclaration*) const;
     127    virtual bool propertyExistsInStyle(StylePropertySet* style) const { return style && style->getPropertyCSSValue(m_propertyID); }
     128    virtual bool valueIsPresentInStyle(Element*, StylePropertySet*) const;
    127129    virtual void addToStyle(Element*, EditingStyle*) const;
    128130
     
    156158}
    157159
    158 bool HTMLElementEquivalent::valueIsPresentInStyle(Element* element, CSSMutableStyleDeclaration* style) const
     160bool HTMLElementEquivalent::valueIsPresentInStyle(Element* element, StylePropertySet* style) const
    159161{
    160162    RefPtr<CSSValue> value = style->getPropertyCSSValue(m_propertyID);
     
    173175        return adoptPtr(new HTMLTextDecorationEquivalent(primitiveValue, tagName));
    174176    }
    175     virtual bool propertyExistsInStyle(CSSMutableStyleDeclaration*) const;
    176     virtual bool valueIsPresentInStyle(Element*, CSSMutableStyleDeclaration*) const;
     177    virtual bool propertyExistsInStyle(StylePropertySet*) const;
     178    virtual bool valueIsPresentInStyle(Element*, StylePropertySet*) const;
    177179
    178180private:
     
    186188}
    187189
    188 bool HTMLTextDecorationEquivalent::propertyExistsInStyle(CSSMutableStyleDeclaration* style) const
     190bool HTMLTextDecorationEquivalent::propertyExistsInStyle(StylePropertySet* style) const
    189191{
    190192    return style->getPropertyCSSValue(CSSPropertyWebkitTextDecorationsInEffect) || style->getPropertyCSSValue(CSSPropertyTextDecoration);
    191193}
    192194
    193 bool HTMLTextDecorationEquivalent::valueIsPresentInStyle(Element* element, CSSMutableStyleDeclaration* style) const
     195bool HTMLTextDecorationEquivalent::valueIsPresentInStyle(Element* element, StylePropertySet* style) const
    194196{
    195197    RefPtr<CSSValue> styleValue = style->getPropertyCSSValue(CSSPropertyWebkitTextDecorationsInEffect);
     
    212214    bool matches(const Element* elem) const { return HTMLElementEquivalent::matches(elem) && elem->hasAttribute(m_attrName); }
    213215    virtual bool hasAttribute() const { return true; }
    214     virtual bool valueIsPresentInStyle(Element*, CSSMutableStyleDeclaration*) const;
     216    virtual bool valueIsPresentInStyle(Element*, StylePropertySet*) const;
    215217    virtual void addToStyle(Element*, EditingStyle*) const;
    216218    virtual PassRefPtr<CSSValue> attributeValueAsCSSValue(Element*) const;
     
    235237}
    236238
    237 bool HTMLAttributeEquivalent::valueIsPresentInStyle(Element* element, CSSMutableStyleDeclaration* style) const
     239bool HTMLAttributeEquivalent::valueIsPresentInStyle(Element* element, StylePropertySet* style) const
    238240{
    239241    RefPtr<CSSValue> value = attributeValueAsCSSValue(element);
     
    257259        return 0;
    258260   
    259     RefPtr<CSSMutableStyleDeclaration> dummyStyle;
    260     dummyStyle = CSSMutableStyleDeclaration::create();
     261    RefPtr<StylePropertySet> dummyStyle;
     262    dummyStyle = StylePropertySet::create();
    261263    dummyStyle->setProperty(m_propertyID, element->getAttribute(m_attrName));
    262264    return dummyStyle->getPropertyCSSValue(m_propertyID);
     
    311313{
    312314    init(position.deprecatedNode(), propertiesToInclude);
     315}
     316
     317EditingStyle::EditingStyle(const StylePropertySet* style)
     318    : m_mutableStyle(style ? style->copy() : 0)
     319    , m_shouldUseFixedDefaultFontSize(false)
     320    , m_fontSizeDelta(NoFontDelta)
     321{
     322    extractFontSizeDelta();
    313323}
    314324
     
    352362}
    353363
     364static inline RGBA32 getRGBAFontColor(StylePropertySet* style)
     365{
     366    return cssValueToRGBA(style->getPropertyCSSValue(CSSPropertyColor).get());
     367}
     368
    354369static inline RGBA32 rgbaBackgroundColorInEffect(Node* node)
    355370{
     
    398413{
    399414    if (!m_mutableStyle)
    400         m_mutableStyle = CSSMutableStyleDeclaration::create();
     415        m_mutableStyle = StylePropertySet::create();
    401416
    402417    m_mutableStyle->setProperty(propertyID, value, important);
     
    470485}
    471486
    472 void EditingStyle::setStyle(PassRefPtr<CSSMutableStyleDeclaration> style)
     487void EditingStyle::setStyle(PassRefPtr<StylePropertySet> style)
    473488{
    474489    m_mutableStyle = style;
     
    479494}
    480495
    481 void EditingStyle::overrideWithStyle(const CSSMutableStyleDeclaration* style)
     496void EditingStyle::overrideWithStyle(const StylePropertySet* style)
    482497{
    483498    if (!style || style->isEmpty())
    484499        return;
    485500    if (!m_mutableStyle)
    486         m_mutableStyle = CSSMutableStyleDeclaration::create();
     501        m_mutableStyle = StylePropertySet::create();
    487502    m_mutableStyle->merge(style);
    488503    extractFontSizeDelta();
     
    521536{
    522537    RefPtr<EditingStyle> textDirection = EditingStyle::create();
    523     textDirection->m_mutableStyle = CSSMutableStyleDeclaration::create();
     538    textDirection->m_mutableStyle = StylePropertySet::create();
    524539    textDirection->m_mutableStyle->setProperty(CSSPropertyUnicodeBidi, CSSValueEmbed, m_mutableStyle->propertyIsImportant(CSSPropertyUnicodeBidi));
    525540    textDirection->m_mutableStyle->setProperty(CSSPropertyDirection, m_mutableStyle->getPropertyValue(CSSPropertyDirection),
     
    544559    if (!node || !node->parentNode())
    545560        return;
    546     RefPtr<CSSMutableStyleDeclaration> parentStyle = editingStyleFromComputedStyle(computedStyle(node->parentNode()), AllEditingProperties);
    547     RefPtr<CSSMutableStyleDeclaration> nodeStyle = editingStyleFromComputedStyle(computedStyle(node), AllEditingProperties);
    548     nodeStyle->removeEquivalentProperties(parentStyle.get());
    549     m_mutableStyle->removeEquivalentProperties(nodeStyle.get());
     561    RefPtr<StylePropertySet> parentStyle = editingStyleFromComputedStyle(computedStyle(node->parentNode()), AllEditingProperties);
     562    RefPtr<StylePropertySet> nodeStyle = editingStyleFromComputedStyle(computedStyle(node), AllEditingProperties);
     563    nodeStyle->removeEquivalentProperties(parentStyle->ensureCSSStyleDeclaration());
     564    m_mutableStyle->removeEquivalentProperties(nodeStyle->ensureCSSStyleDeclaration());
    550565}
    551566
     
    555570        return;
    556571
    557     RefPtr<CSSMutableStyleDeclaration> parentStyle = editingStyleFromComputedStyle(computedStyle(node->parentNode()), AllEditingProperties);
    558     RefPtr<CSSMutableStyleDeclaration> nodeStyle = editingStyleFromComputedStyle(computedStyle(node), AllEditingProperties);
    559     nodeStyle->removeEquivalentProperties(parentStyle.get());
     572    RefPtr<StylePropertySet> parentStyle = editingStyleFromComputedStyle(computedStyle(node->parentNode()), AllEditingProperties);
     573    RefPtr<StylePropertySet> nodeStyle = editingStyleFromComputedStyle(computedStyle(node), AllEditingProperties);
     574    nodeStyle->removeEquivalentProperties(parentStyle->ensureCSSStyleDeclaration());
    560575
    561576    unsigned propertyCount = nodeStyle->propertyCount();
     
    599614    if (!style || !style->m_mutableStyle)
    600615        return FalseTriState;
    601     return triStateOfStyle(style->m_mutableStyle.get(), DoNotIgnoreTextOnlyProperties);
     616    return triStateOfStyle(style->m_mutableStyle->ensureCSSStyleDeclaration(), DoNotIgnoreTextOnlyProperties);
    602617}
    603618
    604619TriState EditingStyle::triStateOfStyle(CSSStyleDeclaration* styleToCompare, ShouldIgnoreTextOnlyProperties shouldIgnoreTextOnlyProperties) const
    605620{
    606     RefPtr<CSSMutableStyleDeclaration> difference = getPropertiesNotIn(m_mutableStyle.get(), styleToCompare);
     621    RefPtr<StylePropertySet> difference = getPropertiesNotIn(m_mutableStyle.get(), styleToCompare);
    607622
    608623    if (shouldIgnoreTextOnlyProperties == IgnoreTextOnlyProperties)
     
    649664    ASSERT(!conflictingProperties || conflictingProperties->isEmpty());
    650665
    651     CSSMutableStyleDeclaration* inlineStyle = element->inlineStyleDecl();
     666    StylePropertySet* inlineStyle = element->inlineStyleDecl();
    652667    if (!m_mutableStyle || !inlineStyle)
    653668        return false;
     
    836851
    837852    if (element->hasAttribute(HTMLNames::styleAttr)) {
    838         if (CSSMutableStyleDeclaration* style = element->inlineStyleDecl()) {
     853        if (StylePropertySet* style = element->inlineStyleDecl()) {
    839854            unsigned propertyCount = style->propertyCount();
    840855            for (unsigned i = 0; i < propertyCount; ++i) {
     
    915930
    916931static inline bool elementMatchesAndPropertyIsNotInInlineStyleDecl(const HTMLElementEquivalent* equivalent, const StyledElement* element,
    917     EditingStyle::CSSPropertyOverrideMode mode, CSSMutableStyleDeclaration* style)
     932    EditingStyle::CSSPropertyOverrideMode mode, StylePropertySet* style)
    918933{
    919934    return equivalent->matches(element) && !equivalent->propertyExistsInStyle(element->inlineStyleDecl())
     
    983998}
    984999
    985 void EditingStyle::mergeStyle(CSSMutableStyleDeclaration* style, CSSPropertyOverrideMode mode)
     1000void EditingStyle::mergeStyle(StylePropertySet* style, CSSPropertyOverrideMode mode)
    9861001{
    9871002    if (!style)
     
    10121027}
    10131028
    1014 static PassRefPtr<CSSMutableStyleDeclaration> styleFromMatchedRulesForElement(Element* element, unsigned rulesToInclude)
    1015 {
    1016     RefPtr<CSSMutableStyleDeclaration> style = CSSMutableStyleDeclaration::create();
     1029static PassRefPtr<StylePropertySet> styleFromMatchedRulesForElement(Element* element, unsigned rulesToInclude)
     1030{
     1031    RefPtr<StylePropertySet> style = StylePropertySet::create();
    10171032    RefPtr<CSSRuleList> matchedRules = element->document()->styleSelector()->styleRulesForElement(element, rulesToInclude);
    10181033    if (matchedRules) {
    10191034        for (unsigned i = 0; i < matchedRules->length(); i++) {
    10201035            if (matchedRules->item(i)->type() == CSSRule::STYLE_RULE) {
    1021                 RefPtr<CSSMutableStyleDeclaration> s = static_cast<CSSStyleRule*>(matchedRules->item(i))->declaration();
     1036                RefPtr<StylePropertySet> s = static_cast<CSSStyleRule*>(matchedRules->item(i))->declaration();
    10221037                style->merge(s.get(), true);
    10231038            }
     
    10301045void EditingStyle::mergeStyleFromRules(StyledElement* element)
    10311046{
    1032     RefPtr<CSSMutableStyleDeclaration> styleFromMatchedRules = styleFromMatchedRulesForElement(element,
     1047    RefPtr<StylePropertySet> styleFromMatchedRules = styleFromMatchedRulesForElement(element,
    10331048        CSSStyleSelector::AuthorCSSRules | CSSStyleSelector::CrossOriginCSSRules);
    10341049    // Styles from the inline style declaration, held in the variable "style", take precedence
     
    10491064    // FIXME: There are others like this, see <rdar://problem/5195123> Slashdot copy/paste fidelity problem
    10501065    RefPtr<CSSComputedStyleDeclaration> computedStyleForElement = computedStyle(element);
    1051     RefPtr<CSSMutableStyleDeclaration> fromComputedStyle = CSSMutableStyleDeclaration::create();
     1066    RefPtr<StylePropertySet> fromComputedStyle = StylePropertySet::create();
    10521067    {
    10531068        unsigned propertyCount = m_mutableStyle->propertyCount();
     
    10661081}
    10671082
    1068 static void removePropertiesInStyle(CSSMutableStyleDeclaration* styleToRemovePropertiesFrom, CSSMutableStyleDeclaration* style)
     1083static void removePropertiesInStyle(StylePropertySet* styleToRemovePropertiesFrom, StylePropertySet* style)
    10691084{
    10701085    unsigned propertyCount = style->propertyCount();
     
    10831098
    10841099    // 1. Remove style from matched rules because style remain without repeating it in inline style declaration
    1085     RefPtr<CSSMutableStyleDeclaration> styleFromMatchedRules = styleFromMatchedRulesForElement(element, CSSStyleSelector::AllButEmptyCSSRules);
     1100    RefPtr<StylePropertySet> styleFromMatchedRules = styleFromMatchedRulesForElement(element, CSSStyleSelector::AllButEmptyCSSRules);
    10861101    if (styleFromMatchedRules && !styleFromMatchedRules->isEmpty())
    1087         m_mutableStyle = getPropertiesNotIn(m_mutableStyle.get(), styleFromMatchedRules.get());
     1102        m_mutableStyle = getPropertiesNotIn(m_mutableStyle.get(), styleFromMatchedRules->ensureCSSStyleDeclaration());
    10881103
    10891104    // 2. Remove style present in context and not overriden by matched rules.
     
    10941109
    10951110        removePropertiesInStyle(computedStyle->m_mutableStyle.get(), styleFromMatchedRules.get());
    1096         m_mutableStyle = getPropertiesNotIn(m_mutableStyle.get(), computedStyle->m_mutableStyle.get());
     1111        m_mutableStyle = getPropertiesNotIn(m_mutableStyle.get(), computedStyle->m_mutableStyle->ensureCSSStyleDeclaration());
    10971112    }
    10981113
     
    11121127        return;
    11131128
    1114     RefPtr<CSSMutableStyleDeclaration> defaultStyle = styleFromMatchedRulesForElement(element, CSSStyleSelector::UAAndUserCSSRules);
     1129    RefPtr<StylePropertySet> defaultStyle = styleFromMatchedRulesForElement(element, CSSStyleSelector::UAAndUserCSSRules);
    11151130
    11161131    removePropertiesInStyle(m_mutableStyle.get(), defaultStyle.get());
     
    11201135{
    11211136    if (!m_mutableStyle)
    1122         m_mutableStyle = CSSMutableStyleDeclaration::create();
     1137        m_mutableStyle = StylePropertySet::create();
    11231138    const bool propertyIsImportant = true;
    11241139    m_mutableStyle->setProperty(CSSPropertyDisplay, CSSValueInline, propertyIsImportant);
     
    11691184}
    11701185
    1171 static void reconcileTextDecorationProperties(CSSMutableStyleDeclaration* style)
     1186static void reconcileTextDecorationProperties(StylePropertySet* style)
    11721187{   
    11731188    RefPtr<CSSValue> textDecorationsInEffect = style->getPropertyCSSValue(CSSPropertyWebkitTextDecorationsInEffect);
     
    12001215    RefPtr<CSSComputedStyleDeclaration> computedStyle = position.computedStyle();
    12011216    // FIXME: take care of background-color in effect
    1202     RefPtr<CSSMutableStyleDeclaration> mutableStyle = getPropertiesNotIn(style->style(), computedStyle.get());
     1217    RefPtr<StylePropertySet> mutableStyle = getPropertiesNotIn(style->style(), computedStyle.get());
    12031218
    12041219    reconcileTextDecorationProperties(mutableStyle.get());
     
    12191234}
    12201235
    1221 static void setTextDecorationProperty(CSSMutableStyleDeclaration* style, const CSSValueList* newTextDecoration, int propertyID)
     1236static void setTextDecorationProperty(StylePropertySet* style, const CSSValueList* newTextDecoration, int propertyID)
    12221237{
    12231238    if (newTextDecoration->length())
     
    12301245}
    12311246
    1232 void StyleChange::extractTextStyles(Document* document, CSSMutableStyleDeclaration* style, bool shouldUseFixedFontDefaultSize)
     1247void StyleChange::extractTextStyles(Document* document, StylePropertySet* style, bool shouldUseFixedFontDefaultSize)
    12331248{
    12341249    ASSERT(style);
     
    12931308}
    12941309
    1295 static void diffTextDecorations(CSSMutableStyleDeclaration* style, int propertID, CSSValue* refTextDecoration)
     1310static void diffTextDecorations(StylePropertySet* style, int propertID, CSSValue* refTextDecoration)
    12961311{
    12971312    RefPtr<CSSValue> textDecoration = style->getPropertyCSSValue(propertID);
     
    13081323}
    13091324
    1310 static bool fontWeightIsBold(CSSStyleDeclaration* style)
    1311 {
    1312     ASSERT(style);
    1313     RefPtr<CSSValue> fontWeight = style->getPropertyCSSValueInternal(CSSPropertyFontWeight);
    1314 
     1325static bool fontWeightIsBold(CSSValue* fontWeight)
     1326{
    13151327    if (!fontWeight)
    13161328        return false;
     
    13201332    // Because b tag can only bold text, there are only two states in plain html: bold and not bold.
    13211333    // Collapse all other values to either one of these two states for editing purposes.
    1322     switch (static_cast<CSSPrimitiveValue*>(fontWeight.get())->getIdent()) {
     1334    switch (static_cast<CSSPrimitiveValue*>(fontWeight)->getIdent()) {
    13231335        case CSSValue100:
    13241336        case CSSValue200:
     
    13371349
    13381350    ASSERT_NOT_REACHED(); // For CSSValueBolder and CSSValueLighter
    1339     return false; // Make compiler happy
    1340 }
    1341 
    1342 static int getTextAlignment(CSSStyleDeclaration* style)
    1343 {
    1344     int textAlign = getIdentifierValue(style, CSSPropertyTextAlign);
    1345     switch (textAlign) {
     1351    return false;
     1352}
     1353
     1354static bool fontWeightIsBold(CSSStyleDeclaration* style)
     1355{
     1356    ASSERT(style);
     1357    RefPtr<CSSValue> fontWeight = style->getPropertyCSSValueInternal(CSSPropertyFontWeight);
     1358    return fontWeightIsBold(fontWeight.get());
     1359}
     1360
     1361static bool fontWeightIsBold(StylePropertySet* style)
     1362{
     1363    ASSERT(style);
     1364    RefPtr<CSSValue> fontWeight = style->getPropertyCSSValue(CSSPropertyFontWeight);
     1365    return fontWeightIsBold(fontWeight.get());
     1366}
     1367
     1368static int getTextAlignment(int textAlignIdentifierValue)
     1369{
     1370    switch (textAlignIdentifierValue) {
    13461371    case CSSValueCenter:
    13471372    case CSSValueWebkitCenter:
     
    13591384}
    13601385
    1361 RefPtr<CSSMutableStyleDeclaration> getPropertiesNotIn(CSSStyleDeclaration* styleWithRedundantProperties, CSSStyleDeclaration* baseStyle)
     1386static int getTextAlignment(CSSStyleDeclaration* style)
     1387{
     1388    return getTextAlignment(getIdentifierValue(style, CSSPropertyTextAlign));
     1389}
     1390
     1391static int getTextAlignment(StylePropertySet* style)
     1392{
     1393    return getTextAlignment(getIdentifierValue(style, CSSPropertyTextAlign));
     1394}
     1395
     1396PassRefPtr<StylePropertySet> getPropertiesNotIn(StylePropertySet* styleWithRedundantProperties, CSSStyleDeclaration* baseStyle)
    13621397{
    13631398    ASSERT(styleWithRedundantProperties);
    13641399    ASSERT(baseStyle);
    1365     RefPtr<CSSMutableStyleDeclaration> result = styleWithRedundantProperties->copy();
     1400    RefPtr<StylePropertySet> result = styleWithRedundantProperties->copy();
    13661401
    13671402    result->removeEquivalentProperties(baseStyle);
     
    13831418}
    13841419
    1385 int getIdentifierValue(CSSStyleDeclaration* style, CSSPropertyID propertyID)
     1420int getIdentifierValue(StylePropertySet* style, CSSPropertyID propertyID)
    13861421{
    13871422    if (!style)
    13881423        return 0;
    1389 
     1424    RefPtr<CSSValue> value = style->getPropertyCSSValue(propertyID);
     1425    if (!value || !value->isPrimitiveValue())
     1426        return 0;
     1427    return static_cast<CSSPrimitiveValue*>(value.get())->getIdent();
     1428}
     1429
     1430int getIdentifierValue(CSSStyleDeclaration* style, CSSPropertyID propertyID)
     1431{
     1432    if (!style)
     1433        return 0;
    13901434    RefPtr<CSSValue> value = style->getPropertyCSSValueInternal(propertyID);
    13911435    if (!value || !value->isPrimitiveValue())
    13921436        return 0;
    1393 
    13941437    return static_cast<CSSPrimitiveValue*>(value.get())->getIdent();
    13951438}
     
    14191462}
    14201463
    1421 bool hasTransparentBackgroundColor(CSSStyleDeclaration* style)
    1422 {
    1423     RefPtr<CSSValue> cssValue = style->getPropertyCSSValueInternal(CSSPropertyBackgroundColor);
     1464bool isTransparentColorValue(CSSValue* cssValue)
     1465{
    14241466    if (!cssValue)
    1425         return true;
    1426    
     1467        return true;   
    14271468    if (!cssValue->isPrimitiveValue())
    14281469        return false;
    1429     CSSPrimitiveValue* value = static_cast<CSSPrimitiveValue*>(cssValue.get());
     1470    CSSPrimitiveValue* value = static_cast<CSSPrimitiveValue*>(cssValue);   
     1471    if (value->isRGBColor())
     1472        return !alphaChannel(value->getRGBA32Value());   
     1473    return value->getIdent() == CSSValueTransparent;
     1474}
     1475
     1476bool hasTransparentBackgroundColor(CSSStyleDeclaration* style)
     1477{
     1478    RefPtr<CSSValue> cssValue = style->getPropertyCSSValueInternal(CSSPropertyBackgroundColor);
     1479    return isTransparentColorValue(cssValue.get());
     1480}
    14301481   
    1431     if (value->isRGBColor())
    1432         return !alphaChannel(value->getRGBA32Value());
    1433    
    1434     return value->getIdent() == CSSValueTransparent;
     1482bool hasTransparentBackgroundColor(StylePropertySet* style)
     1483{
     1484    RefPtr<CSSValue> cssValue = style->getPropertyCSSValue(CSSPropertyBackgroundColor);
     1485    return isTransparentColorValue(cssValue.get());
    14351486}
    14361487
  • trunk/Source/WebCore/editing/EditingStyle.h

    r106247 r106681  
    4444class CSSStyleDeclaration;
    4545class CSSComputedStyleDeclaration;
    46 class CSSMutableStyleDeclaration;
    4746class CSSPrimitiveValue;
    4847class CSSValue;
     
    5453class QualifiedName;
    5554class RenderStyle;
     55class StylePropertySet;
    5656class StyledElement;
    5757class VisibleSelection;
     
    8282    }
    8383
     84    static PassRefPtr<EditingStyle> create(const StylePropertySet* style)
     85    {
     86        return adoptRef(new EditingStyle(style));
     87    }
     88
    8489    static PassRefPtr<EditingStyle> create(const CSSStyleDeclaration* style)
    8590    {
     
    9499    ~EditingStyle();
    95100
    96     CSSMutableStyleDeclaration* style() { return m_mutableStyle.get(); }
     101    StylePropertySet* style() { return m_mutableStyle.get(); }
    97102    bool textDirection(WritingDirection&) const;
    98103    bool isEmpty() const;
    99     void setStyle(PassRefPtr<CSSMutableStyleDeclaration>);
    100     void overrideWithStyle(const CSSMutableStyleDeclaration*);
     104    void setStyle(PassRefPtr<StylePropertySet>);
     105    void overrideWithStyle(const StylePropertySet*);
    101106    void clear();
    102107    PassRefPtr<EditingStyle> copy() const;
     
    145150    EditingStyle(Node*, PropertiesToInclude);
    146151    EditingStyle(const Position&, PropertiesToInclude);
     152    EditingStyle(const StylePropertySet*);
    147153    EditingStyle(const CSSStyleDeclaration*);
    148154    EditingStyle(int propertyID, const String& value);
     
    155161    bool conflictsWithInlineStyleOfElement(StyledElement*, EditingStyle* extractedStyle, Vector<CSSPropertyID>* conflictingProperties) const;
    156162    void mergeInlineAndImplicitStyleOfElement(StyledElement*, CSSPropertyOverrideMode, PropertiesToInclude);
    157     void mergeStyle(CSSMutableStyleDeclaration*, CSSPropertyOverrideMode);
    158 
    159     RefPtr<CSSMutableStyleDeclaration> m_mutableStyle;
     163    void mergeStyle(StylePropertySet*, CSSPropertyOverrideMode);
     164
     165    RefPtr<StylePropertySet> m_mutableStyle;
    160166    bool m_shouldUseFixedDefaultFontSize;
    161167    float m_fontSizeDelta;
     
    202208    }
    203209private:
    204     void extractTextStyles(Document*, CSSMutableStyleDeclaration*, bool shouldUseFixedFontDefaultSize);
     210    void extractTextStyles(Document*, StylePropertySet*, bool shouldUseFixedFontDefaultSize);
    205211
    206212    String m_cssStyle;
     
    218224// FIXME: Remove these functions or make them non-global to discourage using CSSStyleDeclaration directly.
    219225int getIdentifierValue(CSSStyleDeclaration*, CSSPropertyID);
     226int getIdentifierValue(StylePropertySet*, CSSPropertyID);
    220227
    221228} // namespace WebCore
  • trunk/Source/WebCore/editing/Editor.cpp

    r106248 r106681  
    13471347    }
    13481348
    1349     RefPtr<CSSMutableStyleDeclaration> style = CSSMutableStyleDeclaration::create();
     1349    RefPtr<StylePropertySet> style = StylePropertySet::create();
    13501350    style->setProperty(CSSPropertyDirection, direction == LeftToRightWritingDirection ? "ltr" : direction == RightToLeftWritingDirection ? "rtl" : "inherit", false);
    1351     applyParagraphStyleToSelection(style.get(), EditActionSetWritingDirection);
     1351    applyParagraphStyleToSelection(style->ensureCSSStyleDeclaration(), EditActionSetWritingDirection);
    13521352}
    13531353
     
    27462746    if (!element->isStyledElement())
    27472747        return;
    2748     CSSMutableStyleDeclaration* style = static_cast<StyledElement*>(element)->ensureInlineStyleDecl();
     2748    StylePropertySet* style = static_cast<StyledElement*>(element)->ensureInlineStyleDecl();
    27492749    style->setProperty(CSSPropertyWordWrap, "break-word", false);
    27502750    style->setProperty(CSSPropertyWebkitNbspMode, "space", false);
  • trunk/Source/WebCore/editing/EditorCommand.cpp

    r103302 r106681  
    9999}
    100100
    101 static bool applyCommandToFrame(Frame* frame, EditorCommandSource source, EditAction action, CSSMutableStyleDeclaration* style)
     101static bool applyCommandToFrame(Frame* frame, EditorCommandSource source, EditAction action, StylePropertySet* style)
    102102{
    103103    // FIXME: We don't call shouldApplyStyle when the source is DOM; is there a good reason for that?
    104104    switch (source) {
    105105    case CommandFromMenuOrKeyBinding:
    106         frame->editor()->applyStyleToSelection(style, action);
     106        frame->editor()->applyStyleToSelection(style->ensureCSSStyleDeclaration(), action);
    107107        return true;
    108108    case CommandFromDOM:
    109109    case CommandFromDOMWithUserInterface:
    110         frame->editor()->applyStyle(style);
     110        frame->editor()->applyStyle(style->ensureCSSStyleDeclaration());
    111111        return true;
    112112    }
     
    117117static bool executeApplyStyle(Frame* frame, EditorCommandSource source, EditAction action, int propertyID, const String& propertyValue)
    118118{
    119     RefPtr<CSSMutableStyleDeclaration> style = CSSMutableStyleDeclaration::create();
     119    RefPtr<StylePropertySet> style = StylePropertySet::create();
    120120    style->setProperty(propertyID, propertyValue);
    121121    return applyCommandToFrame(frame, source, action, style.get());
     
    124124static bool executeApplyStyle(Frame* frame, EditorCommandSource source, EditAction action, int propertyID, int propertyValue)
    125125{
    126     RefPtr<CSSMutableStyleDeclaration> style = CSSMutableStyleDeclaration::create();
     126    RefPtr<StylePropertySet> style = StylePropertySet::create();
    127127    style->setProperty(propertyID, propertyValue);
    128128    return applyCommandToFrame(frame, source, action, style.get());
     
    152152
    153153    // FIXME: We shouldn't be having to convert new style into text.  We should have setPropertyCSSValue.
    154     RefPtr<CSSMutableStyleDeclaration> newMutableStyle = CSSMutableStyleDeclaration::create();
     154    RefPtr<StylePropertySet> newMutableStyle = StylePropertySet::create();
    155155    newMutableStyle->setProperty(propertyID, newStyle, ec);
    156156    return applyCommandToFrame(frame, source, action, newMutableStyle.get());
     
    175175static bool executeApplyParagraphStyle(Frame* frame, EditorCommandSource source, EditAction action, int propertyID, const String& propertyValue)
    176176{
    177     RefPtr<CSSMutableStyleDeclaration> style = CSSMutableStyleDeclaration::create();
     177    RefPtr<StylePropertySet> style = StylePropertySet::create();
    178178    style->setProperty(propertyID, propertyValue);
    179179    // FIXME: We don't call shouldApplyStyle when the source is DOM; is there a good reason for that?
    180180    switch (source) {
    181181    case CommandFromMenuOrKeyBinding:
    182         frame->editor()->applyParagraphStyleToSelection(style.get(), action);
     182        frame->editor()->applyParagraphStyleToSelection(style->ensureCSSStyleDeclaration(), action);
    183183        return true;
    184184    case CommandFromDOM:
    185185    case CommandFromDOMWithUserInterface:
    186         frame->editor()->applyParagraphStyle(style.get());
     186        frame->editor()->applyParagraphStyle(style->ensureCSSStyleDeclaration());
    187187        return true;
    188188    }
     
    581581static bool executeMakeTextWritingDirectionLeftToRight(Frame* frame, Event*, EditorCommandSource, const String&)
    582582{
    583     RefPtr<CSSMutableStyleDeclaration> style = CSSMutableStyleDeclaration::create();
     583    RefPtr<StylePropertySet> style = StylePropertySet::create();
    584584    style->setProperty(CSSPropertyUnicodeBidi, CSSValueEmbed);
    585585    style->setProperty(CSSPropertyDirection, CSSValueLtr);
    586     frame->editor()->applyStyle(style.get(), EditActionSetWritingDirection);
     586    frame->editor()->applyStyle(style->ensureCSSStyleDeclaration(), EditActionSetWritingDirection);
    587587    return true;
    588588}
     
    590590static bool executeMakeTextWritingDirectionNatural(Frame* frame, Event*, EditorCommandSource, const String&)
    591591{
    592     RefPtr<CSSMutableStyleDeclaration> style = CSSMutableStyleDeclaration::create();
     592    RefPtr<StylePropertySet> style = StylePropertySet::create();
    593593    style->setProperty(CSSPropertyUnicodeBidi, CSSValueNormal);
    594     frame->editor()->applyStyle(style.get(), EditActionSetWritingDirection);
     594    frame->editor()->applyStyle(style->ensureCSSStyleDeclaration(), EditActionSetWritingDirection);
    595595    return true;
    596596}
     
    598598static bool executeMakeTextWritingDirectionRightToLeft(Frame* frame, Event*, EditorCommandSource, const String&)
    599599{
    600     RefPtr<CSSMutableStyleDeclaration> style = CSSMutableStyleDeclaration::create();
     600    RefPtr<StylePropertySet> style = StylePropertySet::create();
    601601    style->setProperty(CSSPropertyUnicodeBidi, CSSValueEmbed);
    602602    style->setProperty(CSSPropertyDirection, CSSValueRtl);
    603     frame->editor()->applyStyle(style.get(), EditActionSetWritingDirection);
     603    frame->editor()->applyStyle(style->ensureCSSStyleDeclaration(), EditActionSetWritingDirection);
    604604    return true;
    605605}
  • trunk/Source/WebCore/editing/FrameSelection.cpp

    r105473 r106681  
    18381838}
    18391839
    1840 PassRefPtr<CSSMutableStyleDeclaration> FrameSelection::copyTypingStyle() const
     1840PassRefPtr<StylePropertySet> FrameSelection::copyTypingStyle() const
    18411841{
    18421842    if (!m_typingStyle || !m_typingStyle->style())
  • trunk/Source/WebCore/editing/FrameSelection.h

    r103365 r106681  
    3939
    4040class CharacterData;
    41 class CSSMutableStyleDeclaration;
    4241class Frame;
    4342class GraphicsContext;
     
    4645class RenderView;
    4746class Settings;
     47class StylePropertySet;
    4848class VisiblePosition;
    4949
     
    236236
    237237    EditingStyle* typingStyle() const;
    238     PassRefPtr<CSSMutableStyleDeclaration> copyTypingStyle() const;
     238    PassRefPtr<StylePropertySet> copyTypingStyle() const;
    239239    void setTypingStyle(PassRefPtr<EditingStyle>);
    240240    void clearTypingStyle();
  • trunk/Source/WebCore/editing/RemoveCSSPropertyCommand.cpp

    r106490 r106681  
    4343void RemoveCSSPropertyCommand::doApply()
    4444{
    45     CSSMutableStyleDeclaration* style = m_element->inlineStyleDecl();
     45    StylePropertySet* style = m_element->inlineStyleDecl();
    4646    m_oldValue = style->getPropertyValue(m_property);
    4747    m_important = style->propertyIsImportant(m_property);
     
    5151void RemoveCSSPropertyCommand::doUnapply()
    5252{
    53     CSSMutableStyleDeclaration* style = m_element->inlineStyleDecl();
     53    StylePropertySet* style = m_element->inlineStyleDecl();
    5454    style->setProperty(m_property, m_oldValue, m_important);
    5555}
  • trunk/Source/WebCore/editing/ReplaceSelectionCommand.cpp

    r106247 r106681  
    482482        StyledElement* element = static_cast<StyledElement*>(node.get());
    483483
    484         CSSMutableStyleDeclaration* inlineStyle = element->inlineStyleDecl();
     484        StylePropertySet* inlineStyle = element->inlineStyleDecl();
    485485        RefPtr<EditingStyle> newInlineStyle = EditingStyle::create(inlineStyle);
    486486        if (inlineStyle) {
  • trunk/Source/WebCore/editing/ReplaceSelectionCommand.h

    r102846 r106681  
    3131namespace WebCore {
    3232
    33 class CSSMutableStyleDeclaration;
    3433class DocumentFragment;
    3534class EditingStyle;
    3635class Node;
    3736class ReplacementFragment;
     37class StylePropertySet;
    3838
    3939class ReplaceSelectionCommand : public CompositeEditCommand {
  • trunk/Source/WebCore/editing/markup.cpp

    r106515 r106681  
    7070using namespace HTMLNames;
    7171
    72 static bool propertyMissingOrEqualToNone(CSSMutableStyleDeclaration*, int propertyID);
     72static bool propertyMissingOrEqualToNone(StylePropertySet*, int propertyID);
    7373
    7474class AttributeChange {
     
    130130    virtual void appendString(const String& s) { return MarkupAccumulator::appendString(s); }
    131131    void wrapWithNode(Node*, bool convertBlocksToInlines = false, RangeFullySelectsNode = DoesFullySelectNode);
    132     void wrapWithStyleNode(CSSMutableStyleDeclaration*, Document*, bool isBlock = false);
     132    void wrapWithStyleNode(StylePropertySet*, Document*, bool isBlock = false);
    133133    String takeResults();
    134134
    135135private:
    136     void appendStyleNodeOpenTag(StringBuilder&, CSSMutableStyleDeclaration*, Document*, bool isBlock = false);
     136    void appendStyleNodeOpenTag(StringBuilder&, StylePropertySet*, Document*, bool isBlock = false);
    137137    const String styleNodeCloseTag(bool isBlock = false);
    138138    virtual void appendText(StringBuilder& out, Text*);
     
    179179}
    180180
    181 void StyledMarkupAccumulator::wrapWithStyleNode(CSSMutableStyleDeclaration* style, Document* document, bool isBlock)
     181void StyledMarkupAccumulator::wrapWithStyleNode(StylePropertySet* style, Document* document, bool isBlock)
    182182{
    183183    StringBuilder openTag;
     
    187187}
    188188
    189 void StyledMarkupAccumulator::appendStyleNodeOpenTag(StringBuilder& out, CSSMutableStyleDeclaration* style, Document* document, bool isBlock)
     189void StyledMarkupAccumulator::appendStyleNodeOpenTag(StringBuilder& out, StylePropertySet* style, Document* document, bool isBlock)
    190190{
    191191    // wrappingStyleForSerialization should have removed -webkit-text-decorations-in-effect
     
    468468}
    469469
    470 static bool propertyMissingOrEqualToNone(CSSMutableStyleDeclaration* style, int propertyID)
     470static bool propertyMissingOrEqualToNone(StylePropertySet* style, int propertyID)
    471471{
    472472    if (!style)
  • trunk/Source/WebCore/html/HTMLTableCellElement.cpp

    r106015 r106681  
    119119}
    120120
    121 PassRefPtr<CSSMutableStyleDeclaration> HTMLTableCellElement::additionalAttributeStyle()
     121PassRefPtr<StylePropertySet> HTMLTableCellElement::additionalAttributeStyle()
    122122{
    123123    ContainerNode* p = parentNode();
  • trunk/Source/WebCore/html/HTMLTableCellElement.h

    r106015 r106681  
    5757    virtual void parseMappedAttribute(Attribute*);
    5858
    59     virtual PassRefPtr<CSSMutableStyleDeclaration> additionalAttributeStyle() OVERRIDE;
     59    virtual PassRefPtr<StylePropertySet> additionalAttributeStyle() OVERRIDE;
    6060
    6161    virtual bool isURLAttribute(Attribute*) const;
  • trunk/Source/WebCore/html/HTMLTableColElement.cpp

    r106015 r106681  
    7878}
    7979
    80 PassRefPtr<CSSMutableStyleDeclaration> HTMLTableColElement::additionalAttributeStyle()
     80PassRefPtr<StylePropertySet> HTMLTableColElement::additionalAttributeStyle()
    8181{
    8282    if (!hasLocalName(colgroupTag))
  • trunk/Source/WebCore/html/HTMLTableColElement.h

    r106015 r106681  
    4545    virtual bool mapToEntry(const QualifiedName&, MappedAttributeEntry&) const;
    4646    virtual void parseMappedAttribute(Attribute*);
    47     virtual PassRefPtr<CSSMutableStyleDeclaration> additionalAttributeStyle() OVERRIDE;
     47    virtual PassRefPtr<StylePropertySet> additionalAttributeStyle() OVERRIDE;
    4848
    4949    int m_span;
  • trunk/Source/WebCore/html/HTMLTableElement.cpp

    r106015 r106681  
    446446}
    447447
    448 static CSSMutableStyleDeclaration* leakBorderStyle(int value)
    449 {
    450     RefPtr<CSSMutableStyleDeclaration> style = CSSMutableStyleDeclaration::create();
     448static StylePropertySet* leakBorderStyle(int value)
     449{
     450    RefPtr<StylePropertySet> style = StylePropertySet::create();
    451451    style->setProperty(CSSPropertyBorderTopStyle, value);
    452452    style->setProperty(CSSPropertyBorderBottomStyle, value);
     
    456456}
    457457
    458 PassRefPtr<CSSMutableStyleDeclaration> HTMLTableElement::additionalAttributeStyle()
     458PassRefPtr<StylePropertySet> HTMLTableElement::additionalAttributeStyle()
    459459{
    460460    if ((!m_borderAttr && !m_borderColorAttr) || m_frameAttr)
     
    462462
    463463    if (m_borderColorAttr) {
    464         static CSSMutableStyleDeclaration* solidBorderStyle = leakBorderStyle(CSSValueSolid);
     464        static StylePropertySet* solidBorderStyle = leakBorderStyle(CSSValueSolid);
    465465        return solidBorderStyle;
    466466    }
    467     static CSSMutableStyleDeclaration* outsetBorderStyle = leakBorderStyle(CSSValueOutset);
     467    static StylePropertySet* outsetBorderStyle = leakBorderStyle(CSSValueOutset);
    468468    return outsetBorderStyle;
    469469}
     
    492492}
    493493
    494 PassRefPtr<CSSMutableStyleDeclaration> HTMLTableElement::createSharedCellStyle()
    495 {
    496     RefPtr<CSSMutableStyleDeclaration> style = CSSMutableStyleDeclaration::create();
     494PassRefPtr<StylePropertySet> HTMLTableElement::createSharedCellStyle()
     495{
     496    RefPtr<StylePropertySet> style = StylePropertySet::create();
    497497
    498498    switch (cellBorders()) {
     
    543543}
    544544
    545 PassRefPtr<CSSMutableStyleDeclaration> HTMLTableElement::additionalCellStyle()
     545PassRefPtr<StylePropertySet> HTMLTableElement::additionalCellStyle()
    546546{
    547547    if (!m_sharedCellStyle)
     
    550550}
    551551
    552 static CSSMutableStyleDeclaration* leakGroupBorderStyle(int rows)
    553 {
    554     RefPtr<CSSMutableStyleDeclaration> style = CSSMutableStyleDeclaration::create();
     552static StylePropertySet* leakGroupBorderStyle(int rows)
     553{
     554    RefPtr<StylePropertySet> style = StylePropertySet::create();
    555555    if (rows) {
    556556        style->setProperty(CSSPropertyBorderTopWidth, CSSValueThin);
     
    567567}
    568568
    569 PassRefPtr<CSSMutableStyleDeclaration> HTMLTableElement::additionalGroupStyle(bool rows)
     569PassRefPtr<StylePropertySet> HTMLTableElement::additionalGroupStyle(bool rows)
    570570{
    571571    if (m_rulesAttr != GroupsRules)
     
    573573
    574574    if (rows) {
    575         static CSSMutableStyleDeclaration* rowBorderStyle = leakGroupBorderStyle(true);
     575        static StylePropertySet* rowBorderStyle = leakGroupBorderStyle(true);
    576576        return rowBorderStyle;
    577577    }
    578     static CSSMutableStyleDeclaration* columnBorderStyle = leakGroupBorderStyle(false);
     578    static StylePropertySet* columnBorderStyle = leakGroupBorderStyle(false);
    579579    return columnBorderStyle;
    580580}
  • trunk/Source/WebCore/html/HTMLTableElement.h

    r106015 r106681  
    6767    virtual void attach();
    6868
    69     PassRefPtr<CSSMutableStyleDeclaration> additionalCellStyle();
    70     PassRefPtr<CSSMutableStyleDeclaration> additionalGroupStyle(bool rows);
     69    PassRefPtr<StylePropertySet> additionalCellStyle();
     70    PassRefPtr<StylePropertySet> additionalGroupStyle(bool rows);
    7171
    7272private:
     
    7878
    7979    // Used to obtain either a solid or outset border decl and to deal with the frame and rules attributes.
    80     virtual PassRefPtr<CSSMutableStyleDeclaration> additionalAttributeStyle() OVERRIDE;
     80    virtual PassRefPtr<StylePropertySet> additionalAttributeStyle() OVERRIDE;
    8181
    8282    virtual void addSubresourceAttributeURLs(ListHashSet<KURL>&) const;
     
    8787    CellBorders cellBorders() const;
    8888
    89     PassRefPtr<CSSMutableStyleDeclaration> createSharedCellStyle();
     89    PassRefPtr<StylePropertySet> createSharedCellStyle();
    9090
    9191    HTMLTableSectionElement* lastBody() const;
     
    9999    unsigned short m_padding;
    100100    OwnPtr<HTMLTableRowsCollection> m_rowsCollection;
    101     RefPtr<CSSMutableStyleDeclaration> m_sharedCellStyle;
     101    RefPtr<StylePropertySet> m_sharedCellStyle;
    102102};
    103103
  • trunk/Source/WebCore/html/HTMLTableSectionElement.cpp

    r106015 r106681  
    4848}
    4949
    50 PassRefPtr<CSSMutableStyleDeclaration> HTMLTableSectionElement::additionalAttributeStyle()
     50PassRefPtr<StylePropertySet> HTMLTableSectionElement::additionalAttributeStyle()
    5151{
    5252    ContainerNode* p = parentNode();
  • trunk/Source/WebCore/html/HTMLTableSectionElement.h

    r106015 r106681  
    5757    HTMLTableSectionElement(const QualifiedName& tagName, Document*);
    5858
    59     virtual PassRefPtr<CSSMutableStyleDeclaration> additionalAttributeStyle() OVERRIDE;
     59    virtual PassRefPtr<StylePropertySet> additionalAttributeStyle() OVERRIDE;
    6060};
    6161
  • trunk/Source/WebCore/html/ValidationMessage.cpp

    r105642 r106681  
    120120    }
    121121
    122     CSSMutableStyleDeclaration* style = bubble->ensureInlineStyleDecl();
     122    StylePropertySet* style = bubble->ensureInlineStyleDecl();
    123123    style->setProperty(CSSPropertyTop, hostY + hostRect.height(), CSSPrimitiveValue::CSS_PX);
    124124    // The 'left' value of ::-webkit-validation-bubble-arrow.
  • trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp

    r106415 r106681  
    19901990void CanvasRenderingContext2D::setFont(const String& newFont)
    19911991{
    1992     RefPtr<CSSMutableStyleDeclaration> tempDecl = CSSMutableStyleDeclaration::create();
     1992    RefPtr<StylePropertySet> tempDecl = StylePropertySet::create();
    19931993    CSSParser parser(!m_usesCSSCompatibilityParseMode);
    19941994
  • trunk/Source/WebCore/html/shadow/MediaControlElements.cpp

    r105642 r106681  
    176176void MediaControlPanelElement::setPosition(const LayoutPoint& position)
    177177{
    178     CSSMutableStyleDeclaration* style = ensureInlineStyleDecl();
     178    StylePropertySet* style = ensureInlineStyleDecl();
    179179
    180180    double left = position.x();
     
    194194void MediaControlPanelElement::resetPosition()
    195195{
    196     CSSMutableStyleDeclaration* style = ensureInlineStyleDecl();
     196    StylePropertySet* style = ensureInlineStyleDecl();
    197197
    198198    style->removeProperty(CSSPropertyLeft);
     
    212212    double duration = document()->page() ? document()->page()->theme()->mediaControlsFadeInDuration() : 0;
    213213
    214     CSSMutableStyleDeclaration* style = ensureInlineStyleDecl();
     214    StylePropertySet* style = ensureInlineStyleDecl();
    215215    style->setProperty(CSSPropertyWebkitTransitionProperty, CSSPropertyOpacity);
    216216    style->setProperty(CSSPropertyWebkitTransitionDuration, duration, CSSPrimitiveValue::CSS_S);
     
    225225        return;
    226226
    227     CSSMutableStyleDeclaration* style = ensureInlineStyleDecl();
     227    StylePropertySet* style = ensureInlineStyleDecl();
    228228    style->setProperty(CSSPropertyWebkitTransitionProperty, CSSPropertyOpacity);
    229229    style->setProperty(CSSPropertyWebkitTransitionDuration, document()->page()->theme()->mediaControlsFadeOutDuration(), CSSPrimitiveValue::CSS_S);
  • trunk/Source/WebCore/html/shadow/SliderThumbElement.cpp

    r105642 r106681  
    335335    RefPtr<TrackLimiterElement> element = adoptRef(new TrackLimiterElement(document));
    336336
    337     CSSMutableStyleDeclaration* style = element->ensureInlineStyleDecl();
     337    StylePropertySet* style = element->ensureInlineStyleDecl();
    338338    style->setProperty(CSSPropertyVisibility, CSSValueHidden);
    339339    style->setProperty(CSSPropertyPosition, CSSValueStatic);
  • trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp

    r106515 r106681  
    728728        RefPtr<InspectorObject> attrStyleObject = InspectorObject::create();
    729729        String attributeName = attribute->localName();
    730         RefPtr<InspectorStyle> inspectorStyle = InspectorStyle::create(InspectorCSSId(), attribute->decl(), 0);
     730        RefPtr<InspectorStyle> inspectorStyle = InspectorStyle::create(InspectorCSSId(), attribute->decl()->ensureCSSStyleDeclaration(), 0);
    731731        attrStyleObject->setString("name", attributeName.utf8().data());
    732732        attrStyleObject->setObject("style", inspectorStyle->buildObjectForStyle());
  • trunk/Source/WebCore/inspector/InspectorStyleSheet.cpp

    r106393 r106681  
    295295
    296296    if (propertyText.stripWhiteSpace().length()) {
    297         RefPtr<CSSMutableStyleDeclaration> tempMutableStyle = CSSMutableStyleDeclaration::create();
     297        RefPtr<StylePropertySet> tempMutableStyle = StylePropertySet::create();
    298298        RefPtr<CSSStyleSourceData> sourceData = CSSStyleSourceData::create();
    299299        CSSParser p;
     
    13181318    }
    13191319
    1320     RefPtr<CSSMutableStyleDeclaration> tempDeclaration = CSSMutableStyleDeclaration::create();
     1320    RefPtr<StylePropertySet> tempDeclaration = StylePropertySet::create();
    13211321    CSSParser p;
    13221322    p.parseDeclaration(tempDeclaration.get(), m_styleText, result, m_element->document()->elementSheet());
  • trunk/Source/WebCore/page/DragController.cpp

    r106530 r106681  
    448448            return false;
    449449        RefPtr<Range> innerRange = innerFrame->selection()->toNormalizedRange();
    450         RefPtr<CSSMutableStyleDeclaration> style = CSSMutableStyleDeclaration::create();
     450        RefPtr<StylePropertySet> style = StylePropertySet::create();
    451451        style->setProperty(CSSPropertyColor, color.serialized(), false);
    452         if (!innerFrame->editor()->shouldApplyStyle(style.get(), innerRange.get()))
     452        if (!innerFrame->editor()->shouldApplyStyle(style->ensureCSSStyleDeclaration(), innerRange.get()))
    453453            return false;
    454454        m_client->willPerformDragDestinationAction(DragDestinationActionEdit, dragData);
    455         innerFrame->editor()->applyStyle(style.get(), EditActionSetColor);
     455        innerFrame->editor()->applyStyle(style->ensureCSSStyleDeclaration(), EditActionSetColor);
    456456        return true;
    457457    }
  • trunk/Source/WebCore/page/PageSerializer.cpp

    r106568 r106681  
    308308}
    309309
    310 void PageSerializer::retrieveResourcesForCSSDeclaration(CSSMutableStyleDeclaration* styleDeclaration, Document* document)
     310void PageSerializer::retrieveResourcesForCSSDeclaration(StylePropertySet* styleDeclaration, Document* document)
    311311{
    312312    if (!styleDeclaration)
  • trunk/Source/WebCore/page/PageSerializer.h

    r106568 r106681  
    4242
    4343class CachedImage;
    44 class CSSMutableStyleDeclaration;
    4544class CSSStyleRule;
    4645class CSSStyleSheet;
     
    4948class Page;
    5049class RenderObject;
     50class StylePropertySet;
    5151
    5252// This class is used to serialize a page contents back to text (typically HTML).
     
    7979
    8080    void addImageToResources(CachedImage*, RenderObject*, const KURL&);
    81     void retrieveResourcesForCSSDeclaration(CSSMutableStyleDeclaration*, Document*);
     81    void retrieveResourcesForCSSDeclaration(StylePropertySet*, Document*);
    8282    void retrieveResourcesForCSSRule(CSSStyleRule*, Document*);
    8383
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r106554 r106681  
    17081708
    17091709    ASSERT(element->isStyledElement());
    1710     CSSMutableStyleDeclaration* styleDeclaration = static_cast<StyledElement*>(element)->ensureInlineStyleDecl();
     1710    StylePropertySet* styleDeclaration = static_cast<StyledElement*>(element)->ensureInlineStyleDecl();
    17111711    bool isBoxSizingBorder = renderer->style()->boxSizing() == BORDER_BOX;
    17121712
  • trunk/Source/WebCore/rendering/RenderTreeAsText.cpp

    r106247 r106681  
    184184        return true;
    185185
    186     CSSMutableStyleDeclaration* inlineStyleDecl = elem->inlineStyleDecl();
     186    StylePropertySet* inlineStyleDecl = elem->inlineStyleDecl();
    187187    return (!inlineStyleDecl || inlineStyleDecl->isEmpty());
    188188}
  • trunk/Source/WebCore/svg/SVGFontFaceElement.cpp

    r106393 r106681  
    5252{
    5353    ASSERT(hasTagName(font_faceTag));
    54     RefPtr<CSSMutableStyleDeclaration> styleDeclaration = CSSMutableStyleDeclaration::create(m_fontFaceRule.get());
     54    RefPtr<StylePropertySet> styleDeclaration = StylePropertySet::create(m_fontFaceRule.get());
    5555    styleDeclaration->setStrictParsing(true);
    5656    m_fontFaceRule->setDeclaration(styleDeclaration.release());
  • trunk/Source/WebKit/mac/ChangeLog

    r106678 r106681  
     12012-02-03  Antti Koivisto  <antti@apple.com>
     2
     3        https://bugs.webkit.org/show_bug.cgi?id=77740
     4        Split CSSMutableStyleDeclaration into separate internal and CSSOM types
     5
     6        Reviewed by Andreas Kling and Darin Adler.
     7
     8        * WebView/WebFrame.mm:
     9        (-[WebFrame _typingStyle]):
     10
    1112012-02-03  Beth Dakin  <bdakin@apple.com>
    212
  • trunk/Source/WebKit/mac/WebView/WebFrame.mm

    r105698 r106681  
    5656#import <WebCore/AccessibilityObject.h>
    5757#import <WebCore/AnimationController.h>
    58 #import <WebCore/CSSMutableStyleDeclaration.h>
     58#import <WebCore/CSSStyleDeclaration.h>
    5959#import <WebCore/CachedResourceLoader.h>
    6060#import <WebCore/Chrome.h>
     
    792792    if (!_private->coreFrame)
    793793        return nil;
    794     RefPtr<CSSMutableStyleDeclaration> typingStyle = _private->coreFrame->selection()->copyTypingStyle();
     794    RefPtr<CSSStyleDeclaration> typingStyle = _private->coreFrame->selection()->copyTypingStyle()->ensureCSSStyleDeclaration();
    795795    if (!typingStyle)
    796796        return nil;
  • trunk/Source/WebKit/qt/Api/qwebelement.cpp

    r106515 r106681  
    845845        return QString();
    846846
    847     CSSMutableStyleDeclaration* style = static_cast<StyledElement*>(m_element)->ensureInlineStyleDecl();
     847    StylePropertySet* style = static_cast<StyledElement*>(m_element)->ensureInlineStyleDecl();
    848848
    849849    if (strategy == InlineStyle)
     
    910910
    911911    int propID = cssPropertyID(name);
    912     CSSMutableStyleDeclaration* style = static_cast<StyledElement*>(m_element)->ensureInlineStyleDecl();
     912    StylePropertySet* style = static_cast<StyledElement*>(m_element)->ensureInlineStyleDecl();
    913913    if (!propID || !style)
    914914        return;
  • trunk/Source/WebKit/qt/ChangeLog

    r106659 r106681  
     12012-02-03  Antti Koivisto  <antti@apple.com>
     2
     3        https://bugs.webkit.org/show_bug.cgi?id=77740
     4        Split CSSMutableStyleDeclaration into separate internal and CSSOM types
     5
     6        Reviewed by Andreas Kling and Darin Adler.
     7
     8        * Api/qwebelement.cpp:
     9        (QWebElement::styleProperty):
     10
    1112012-02-03  No'am Rosenthal  <noam.rosenthal@nokia.com>
    212
Note: See TracChangeset for help on using the changeset viewer.