Avoid using CSSOM style declarations in HTML editing.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 May 2013 12:53:18 +0000 (12:53 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 May 2013 12:53:18 +0000 (12:53 +0000)
<http://webkit.org/b/117019>

Reviewed by Antti Koivisto.

Convert the editing code to use ComputedStyleExtractor instead of instantiating CSSOM wrappers.

* css/CSSComputedStyleDeclaration.h:
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::getFontSizeCSSValuePreferringKeyword):
(WebCore::ComputedStyleExtractor::useFixedFontDefaultSize):
(WebCore::ComputedStyleExtractor::propertyMatches):
(WebCore::ComputedStyleExtractor::copyProperties):
(WebCore::ComputedStyleExtractor::copyPropertiesInSet):

    Moved here from CSSComputedStyleDeclaration. These methods are used by HTML editing.

(WebCore::CSSComputedStyleDeclaration::copyProperties):

    Reimplemented to call ComputedStyleExtractor.

* css/CSSStyleDeclaration.h:
* css/PropertySetCSSStyleDeclaration.h:
* css/PropertySetCSSStyleDeclaration.cpp:
(WebCore::PropertySetCSSStyleDeclaration::copyProperties):

    Removed CSSStyleDeclaration::cssPropertyMatches(), the remaining code lives in
    ComputedStyleExtractor::propertyMatches() and is only used by HTML editing.

* css/StylePropertySet.h:
* css/StylePropertySet.cpp:
(WebCore::MutableStylePropertySet::removeEquivalentProperties):

    Added an overload that takes a ComputedStyleExtractor.
    This code should move into EditingStyle.cpp, material for a follow-up patch.

* editing/ApplyStyleCommand.cpp:
(WebCore::toIdentifier):

    Add a file-local helper for yanking the identifier value (if any) out of a CSSPrimitiveValue.

(WebCore::ApplyStyleCommand::splitAncestorsWithUnicodeBidi):
(WebCore::ApplyStyleCommand::removeEmbeddingUpToEnclosingBlock):
(WebCore::highestEmbeddingAncestor):
* editing/EditingStyle.h:
* editing/EditingStyle.cpp:
(WebCore::editingStyleFromComputedStyle):
(WebCore::extractPropertyValue):
(WebCore::identifierForStyleProperty):
(WebCore::textColorFromStyle):
(WebCore::backgroundColorFromStyle):
(WebCore::EditingStyle::init):
(WebCore::EditingStyle::removeStyleAddedByNode):
(WebCore::EditingStyle::removeStyleConflictingWithStyleOfNode):
(WebCore::EditingStyle::triStateOfStyle):
(WebCore::EditingStyle::styleIsPresentInComputedStyleOfNode):
(WebCore::EditingStyle::removeStyleFromRulesAndContext):
(WebCore::StyleChange::StyleChange):
(WebCore::fontWeightIsBold):
(WebCore::extractPropertiesNotIn):
(WebCore::getPropertiesNotIn):

    Use ComputedStyleExtractor instead of CSSComputedStyleDeclaration in all of this code.
    Templatized a bunch of the code so we don't have to repeat ourselves for both StylePropertySet
    and ComputedStyleExtractor inputs.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@150960 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/CSSComputedStyleDeclaration.h
Source/WebCore/css/CSSStyleDeclaration.h
Source/WebCore/css/PropertySetCSSStyleDeclaration.cpp
Source/WebCore/css/PropertySetCSSStyleDeclaration.h
Source/WebCore/css/StylePropertySet.cpp
Source/WebCore/css/StylePropertySet.h
Source/WebCore/editing/ApplyStyleCommand.cpp
Source/WebCore/editing/EditingStyle.cpp
Source/WebCore/editing/EditingStyle.h

index 5f1a714..fe86b79 100644 (file)
@@ -1,3 +1,71 @@
+2013-05-30  Andreas Kling  <akling@apple.com>
+
+        Avoid using CSSOM style declarations in HTML editing.
+        <http://webkit.org/b/117019>
+
+        Reviewed by Antti Koivisto.
+
+        Convert the editing code to use ComputedStyleExtractor instead of instantiating CSSOM wrappers.
+
+        * css/CSSComputedStyleDeclaration.h:
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::ComputedStyleExtractor::getFontSizeCSSValuePreferringKeyword):
+        (WebCore::ComputedStyleExtractor::useFixedFontDefaultSize):
+        (WebCore::ComputedStyleExtractor::propertyMatches):
+        (WebCore::ComputedStyleExtractor::copyProperties):
+        (WebCore::ComputedStyleExtractor::copyPropertiesInSet):
+
+            Moved here from CSSComputedStyleDeclaration. These methods are used by HTML editing.
+
+        (WebCore::CSSComputedStyleDeclaration::copyProperties):
+
+            Reimplemented to call ComputedStyleExtractor.
+
+        * css/CSSStyleDeclaration.h:
+        * css/PropertySetCSSStyleDeclaration.h:
+        * css/PropertySetCSSStyleDeclaration.cpp:
+        (WebCore::PropertySetCSSStyleDeclaration::copyProperties):
+
+            Removed CSSStyleDeclaration::cssPropertyMatches(), the remaining code lives in
+            ComputedStyleExtractor::propertyMatches() and is only used by HTML editing.
+
+        * css/StylePropertySet.h:
+        * css/StylePropertySet.cpp:
+        (WebCore::MutableStylePropertySet::removeEquivalentProperties):
+
+            Added an overload that takes a ComputedStyleExtractor.
+            This code should move into EditingStyle.cpp, material for a follow-up patch.
+
+        * editing/ApplyStyleCommand.cpp:
+        (WebCore::toIdentifier):
+
+            Add a file-local helper for yanking the identifier value (if any) out of a CSSPrimitiveValue.
+
+        (WebCore::ApplyStyleCommand::splitAncestorsWithUnicodeBidi):
+        (WebCore::ApplyStyleCommand::removeEmbeddingUpToEnclosingBlock):
+        (WebCore::highestEmbeddingAncestor):
+        * editing/EditingStyle.h:
+        * editing/EditingStyle.cpp:
+        (WebCore::editingStyleFromComputedStyle):
+        (WebCore::extractPropertyValue):
+        (WebCore::identifierForStyleProperty):
+        (WebCore::textColorFromStyle):
+        (WebCore::backgroundColorFromStyle):
+        (WebCore::EditingStyle::init):
+        (WebCore::EditingStyle::removeStyleAddedByNode):
+        (WebCore::EditingStyle::removeStyleConflictingWithStyleOfNode):
+        (WebCore::EditingStyle::triStateOfStyle):
+        (WebCore::EditingStyle::styleIsPresentInComputedStyleOfNode):
+        (WebCore::EditingStyle::removeStyleFromRulesAndContext):
+        (WebCore::StyleChange::StyleChange):
+        (WebCore::fontWeightIsBold):
+        (WebCore::extractPropertiesNotIn):
+        (WebCore::getPropertiesNotIn):
+
+            Use ComputedStyleExtractor instead of CSSComputedStyleDeclaration in all of this code.
+            Templatized a bunch of the code so we don't have to repeat ourselves for both StylePropertySet
+            and ComputedStyleExtractor inputs.
+
 2013-05-30  Roland Takacs  <rtakacs@inf.u-szeged.hu>
 
         Remove "hidden"=true from Inspector.json
index f819eb1..b52d71f 100644 (file)
@@ -1265,7 +1265,7 @@ static int cssIdentifierForFontSizeKeyword(int keywordSize)
     return CSSValueXxSmall + keywordSize - 1;
 }
 
-PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getFontSizeCSSValuePreferringKeyword() const
+PassRefPtr<CSSPrimitiveValue> ComputedStyleExtractor::getFontSizeCSSValuePreferringKeyword() const
 {
     if (!m_node)
         return 0;
@@ -1279,11 +1279,10 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getFontSizeCSSValuePreferringK
     if (int keywordSize = style->fontDescription().keywordSize())
         return cssValuePool().createIdentifierValue(cssIdentifierForFontSizeKeyword(keywordSize));
 
-
     return zoomAdjustedPixelValue(style->fontDescription().computedPixelSize(), style.get());
 }
 
-bool CSSComputedStyleDeclaration::useFixedFontDefaultSize() const
+bool ComputedStyleExtractor::useFixedFontDefaultSize() const
 {
     if (!m_node)
         return false;
@@ -1313,11 +1312,6 @@ PassRefPtr<CSSValue> ComputedStyleExtractor::valueForShadow(const ShadowData* sh
     return list.release();
 }
 
-PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(CSSPropertyID propertyID) const
-{
-    return getPropertyCSSValue(propertyID, UpdateLayout);
-}
-
 static int identifierForFamily(const AtomicString& family)
 {
     if (family == cursiveFamily)
@@ -1567,6 +1561,11 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(CSSPropert
     return ComputedStyleExtractor(m_node, m_allowVisitedStyle, m_pseudoElementSpecifier).propertyValue(propertyID, updateLayout);
 }
 
+PassRefPtr<MutableStylePropertySet> CSSComputedStyleDeclaration::copyProperties() const
+{
+    return ComputedStyleExtractor(m_node, m_allowVisitedStyle, m_pseudoElementSpecifier).copyProperties();
+}
+
 PassRefPtr<CSSValue> ComputedStyleExtractor::propertyValue(CSSPropertyID propertyID, EUpdateLayout updateLayout) const
 {
     Node* styledNode = this->styledNode();
@@ -2939,7 +2938,6 @@ String CSSComputedStyleDeclaration::getPropertyValue(CSSPropertyID propertyID) c
     return "";
 }
 
-
 unsigned CSSComputedStyleDeclaration::length() const
 {
     Node* node = m_node.get();
@@ -2961,23 +2959,23 @@ String CSSComputedStyleDeclaration::item(unsigned i) const
     return getPropertyNameString(computedProperties[i]);
 }
 
-bool CSSComputedStyleDeclaration::cssPropertyMatches(CSSPropertyID propertyID, const CSSValue* propertyValue) const
+bool ComputedStyleExtractor::propertyMatches(CSSPropertyID propertyID, const CSSValue* value) const
 {
-    if (propertyID == CSSPropertyFontSize && propertyValue->isPrimitiveValue() && m_node) {
+    if (propertyID == CSSPropertyFontSize && value->isPrimitiveValue() && m_node) {
         m_node->document()->updateLayoutIgnorePendingStylesheets();
         RenderStyle* style = m_node->computedStyle(m_pseudoElementSpecifier);
         if (style && style->fontDescription().keywordSize()) {
             int sizeValue = cssIdentifierForFontSizeKeyword(style->fontDescription().keywordSize());
-            const CSSPrimitiveValue* primitiveValue = static_cast<const CSSPrimitiveValue*>(propertyValue);
+            const CSSPrimitiveValue* primitiveValue = static_cast<const CSSPrimitiveValue*>(value);
             if (primitiveValue->isIdent() && primitiveValue->getIdent() == sizeValue)
                 return true;
         }
     }
-    RefPtr<CSSValue> value = getPropertyCSSValue(propertyID);
-    return value && propertyValue && value->equals(*propertyValue);
+    RefPtr<CSSValue> computedValue = propertyValue(propertyID);
+    return computedValue && value && computedValue->equals(*value);
 }
 
-PassRefPtr<MutableStylePropertySet> CSSComputedStyleDeclaration::copyProperties() const
+PassRefPtr<MutableStylePropertySet> ComputedStyleExtractor::copyProperties() const
 {
     return copyPropertiesInSet(computedProperties, numComputedProperties);
 }
@@ -3030,12 +3028,12 @@ PassRefPtr<CSSValueList> ComputedStyleExtractor::getCSSPropertyValuesForGridShor
     return list.release();
 }
 
-PassRefPtr<MutableStylePropertySet> CSSComputedStyleDeclaration::copyPropertiesInSet(const CSSPropertyID* set, unsigned length) const
+PassRefPtr<MutableStylePropertySet> ComputedStyleExtractor::copyPropertiesInSet(const CSSPropertyID* set, unsigned length) const
 {
     Vector<CSSProperty, 256> list;
     list.reserveInitialCapacity(length);
     for (unsigned i = 0; i < length; ++i) {
-        RefPtr<CSSValue> value = getPropertyCSSValue(set[i]);
+        RefPtr<CSSValue> value = propertyValue(set[i]);
         if (value)
             list.append(CSSProperty(set[i], value.release(), false));
     }
index 11c1fbf..17f04cc 100644 (file)
@@ -53,6 +53,13 @@ public:
 
     PassRefPtr<CSSValue> propertyValue(CSSPropertyID, EUpdateLayout = UpdateLayout) const;
 
+    // Helper methods for HTML editing.
+    PassRefPtr<MutableStylePropertySet> copyPropertiesInSet(const CSSPropertyID* set, unsigned length) const;
+    PassRefPtr<MutableStylePropertySet> copyProperties() const;
+    PassRefPtr<CSSPrimitiveValue> getFontSizeCSSValuePreferringKeyword() const;
+    bool useFixedFontDefaultSize() const;
+    bool propertyMatches(CSSPropertyID, const CSSValue*) const;
+
 private:
     // The styled node is either the node passed into computedPropertyValue, or the
     // PseudoElement for :before and :after if they exist.
@@ -93,17 +100,7 @@ public:
     virtual void ref() OVERRIDE;
     virtual void deref() OVERRIDE;
 
-    PassRefPtr<CSSValue> getPropertyCSSValue(CSSPropertyID) const;
     String getPropertyValue(CSSPropertyID) const;
-    bool getPropertyPriority(CSSPropertyID) const;
-
-    virtual PassRefPtr<MutableStylePropertySet> copyProperties() const OVERRIDE;
-
-    PassRefPtr<CSSValue> getPropertyCSSValue(CSSPropertyID, EUpdateLayout) const;
-    PassRefPtr<CSSValue> getFontSizeCSSValuePreferringKeyword() const;
-    bool useFixedFontDefaultSize() const;
-
-    PassRefPtr<MutableStylePropertySet> copyPropertiesInSet(const CSSPropertyID* set, unsigned length) const;
 
 private:
     CSSComputedStyleDeclaration(PassRefPtr<Node>, bool allowVisitedStyle, const String&);
@@ -124,8 +121,9 @@ private:
     virtual PassRefPtr<CSSValue> getPropertyCSSValueInternal(CSSPropertyID);
     virtual String getPropertyValueInternal(CSSPropertyID);
     virtual void setPropertyInternal(CSSPropertyID, const String& value, bool important, ExceptionCode&);
+    virtual PassRefPtr<MutableStylePropertySet> copyProperties() const OVERRIDE;
 
-    virtual bool cssPropertyMatches(CSSPropertyID, const CSSValue*) const OVERRIDE;
+    PassRefPtr<CSSValue> getPropertyCSSValue(CSSPropertyID, EUpdateLayout = UpdateLayout) const;
 
     RefPtr<Node> m_node;
     PseudoId m_pseudoElementSpecifier;
index ddd85d0..c5cf90b 100644 (file)
@@ -67,7 +67,6 @@ public:
 
     virtual PassRefPtr<MutableStylePropertySet> copyProperties() const = 0;
 
-    virtual bool cssPropertyMatches(CSSPropertyID, const CSSValue*) const = 0;
     virtual CSSStyleSheet* parentStyleSheet() const { return 0; }
 
 protected:
index 0b56854..9499eae 100644 (file)
@@ -294,11 +294,6 @@ PassRefPtr<MutableStylePropertySet> PropertySetCSSStyleDeclaration::copyProperti
 {
     return m_propertySet->mutableCopy();
 }
-
-bool PropertySetCSSStyleDeclaration::cssPropertyMatches(CSSPropertyID propertyID, const CSSValue* propertyValue) const
-{
-    return m_propertySet->propertyMatches(propertyID, propertyValue);
-}
     
 StyleRuleCSSStyleDeclaration::StyleRuleCSSStyleDeclaration(MutableStylePropertySet* propertySet, CSSRule* parentRule)
     : PropertySetCSSStyleDeclaration(propertySet)
index d7dadb9..4df488f 100644 (file)
@@ -68,7 +68,6 @@ private:
     virtual String getPropertyValueInternal(CSSPropertyID) OVERRIDE;
     virtual void setPropertyInternal(CSSPropertyID, const String& value, bool important, ExceptionCode&) OVERRIDE;
     
-    virtual bool cssPropertyMatches(CSSPropertyID, const CSSValue*) const OVERRIDE;
     virtual PassRefPtr<MutableStylePropertySet> copyProperties() const OVERRIDE;
 
     CSSValue* cloneAndCacheForCSSOM(CSSValue*);
index 42f647d..7289bd8 100644 (file)
@@ -22,6 +22,7 @@
 #include "config.h"
 #include "StylePropertySet.h"
 
+#include "CSSComputedStyleDeclaration.h"
 #include "CSSParser.h"
 #include "CSSValueKeywords.h"
 #include "CSSValueList.h"
@@ -1142,7 +1143,7 @@ bool StylePropertySet::propertyMatches(CSSPropertyID propertyID, const CSSValue*
         return false;
     return propertyAt(foundPropertyIndex).value()->equals(*propertyValue);
 }
-    
+
 void MutableStylePropertySet::removeEquivalentProperties(const StylePropertySet* style)
 {
     Vector<CSSPropertyID> propertiesToRemove;
@@ -1157,13 +1158,13 @@ void MutableStylePropertySet::removeEquivalentProperties(const StylePropertySet*
         removeProperty(propertiesToRemove[i]);
 }
 
-void MutableStylePropertySet::removeEquivalentProperties(const CSSStyleDeclaration* style)
+void MutableStylePropertySet::removeEquivalentProperties(const ComputedStyleExtractor* computedStyle)
 {
     Vector<CSSPropertyID> propertiesToRemove;
     unsigned size = m_propertyVector.size();
     for (unsigned i = 0; i < size; ++i) {
         PropertyReference property = propertyAt(i);
-        if (style->cssPropertyMatches(property.id(), property.value()))
+        if (computedStyle->propertyMatches(property.id(), property.value()))
             propertiesToRemove.append(property.id());
     }    
     // FIXME: This should use mass removal.
index 4d14ecc..b307c5c 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * (C) 1999-2003 Lars Knoll (knoll@kde.org)
- * Copyright (C) 2004, 2005, 2006, 2008, 2012 Apple Inc. All rights reserved.
+ * Copyright (C) 2004, 2005, 2006, 2008, 2012, 2013 Apple Inc. All rights reserved.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -33,6 +33,7 @@ namespace WebCore {
 
 class CSSRule;
 class CSSStyleDeclaration;
+class ComputedStyleExtractor;
 class ImmutableStylePropertySet;
 class KURL;
 class MutableStylePropertySet;
@@ -209,8 +210,10 @@ public:
     void removePrefixedOrUnprefixedProperty(CSSPropertyID);
     void removeBlockProperties();
     bool removePropertiesInSet(const CSSPropertyID* set, unsigned length);
+
+    // FIXME: These two can be moved to EditingStyle.cpp
     void removeEquivalentProperties(const StylePropertySet*);
-    void removeEquivalentProperties(const CSSStyleDeclaration*);
+    void removeEquivalentProperties(const ComputedStyleExtractor*);
 
     void mergeAndOverrideOnConflict(const StylePropertySet*);
 
index 5cec38a..d095a3b 100644 (file)
@@ -56,6 +56,11 @@ namespace WebCore {
 
 using namespace HTMLNames;
 
+static int toIdentifier(PassRefPtr<CSSValue> value)
+{
+    return (value && value->isPrimitiveValue()) ? static_pointer_cast<CSSPrimitiveValue>(value)->getIdent() : 0;
+}
+
 static String& styleSpanClassString()
 {
     DEFINE_STATIC_LOCAL(String, styleSpanClassString, ((AppleStyleSpanClass)));
@@ -456,7 +461,7 @@ HTMLElement* ApplyStyleCommand::splitAncestorsWithUnicodeBidi(Node* node, bool b
     Node* nextHighestAncestorWithUnicodeBidi = 0;
     int highestAncestorUnicodeBidi = 0;
     for (Node* n = node->parentNode(); n != block; n = n->parentNode()) {
-        int unicodeBidi = getIdentifierValue(n, CSSPropertyUnicodeBidi);
+        int unicodeBidi = toIdentifier(ComputedStyleExtractor(n).propertyValue(CSSPropertyUnicodeBidi));
         if (unicodeBidi && unicodeBidi != CSSValueNormal) {
             highestAncestorUnicodeBidi = unicodeBidi;
             nextHighestAncestorWithUnicodeBidi = highestAncestorWithUnicodeBidi;
@@ -508,7 +513,7 @@ void ApplyStyleCommand::removeEmbeddingUpToEnclosingBlock(Node* node, Node* unsp
             continue;
 
         StyledElement* element = static_cast<StyledElement*>(n);
-        int unicodeBidi = getIdentifierValue(element, CSSPropertyUnicodeBidi);
+        int unicodeBidi = toIdentifier(ComputedStyleExtractor(element).propertyValue(CSSPropertyUnicodeBidi));
         if (!unicodeBidi || unicodeBidi == CSSValueNormal)
             continue;
 
@@ -534,7 +539,7 @@ void ApplyStyleCommand::removeEmbeddingUpToEnclosingBlock(Node* node, Node* unsp
 static Node* highestEmbeddingAncestor(Node* startNode, Node* enclosingNode)
 {
     for (Node* n = startNode; n && n != enclosingNode; n = n->parentNode()) {
-        if (n->isHTMLElement() && getIdentifierValue(n, CSSPropertyUnicodeBidi) == CSSValueEmbed)
+        if (n->isHTMLElement() && toIdentifier(ComputedStyleExtractor(n).propertyValue(CSSPropertyUnicodeBidi)) == CSSValueEmbed)
             return n;
     }
 
index 9747446..add5345 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007, 2008, 2009 Apple Computer, Inc.
+ * Copyright (C) 2007, 2008, 2009, 2013 Apple Computer, Inc.
  * Copyright (C) 2010, 2011 Google Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -102,14 +102,32 @@ static inline bool isEditingProperty(int id)
     return false;
 }
 
-static PassRefPtr<MutableStylePropertySet> editingStyleFromComputedStyle(PassRefPtr<CSSComputedStyleDeclaration> style, EditingPropertiesType type = OnlyInheritableEditingProperties)
+static PassRefPtr<MutableStylePropertySet> editingStyleFromComputedStyle(PassRefPtr<Node> node, EditingPropertiesType type = OnlyInheritableEditingProperties)
 {
-    if (!style)
-        return MutableStylePropertySet::create();
-    return copyEditingProperties(style.get(), type);
+    ComputedStyleExtractor computedStyle(node);
+    return copyEditingProperties(&computedStyle, type);
 }
 
-static PassRefPtr<MutableStylePropertySet> getPropertiesNotIn(StylePropertySet* styleWithRedundantProperties, CSSStyleDeclaration* baseStyle);
+static PassRefPtr<CSSValue> extractPropertyValue(const StylePropertySet* style, CSSPropertyID propertyID)
+{
+    return style ? style->getPropertyCSSValue(propertyID) : PassRefPtr<CSSValue>();
+}
+
+static PassRefPtr<CSSValue> extractPropertyValue(ComputedStyleExtractor* computedStyle, CSSPropertyID propertyID)
+{
+    return computedStyle->propertyValue(propertyID);
+}
+
+template<typename T>
+int identifierForStyleProperty(T* style, CSSPropertyID propertyID)
+{
+    RefPtr<CSSValue> value = extractPropertyValue(style, propertyID);
+    if (!value || !value->isPrimitiveValue())
+        return 0;
+    return static_cast<CSSPrimitiveValue*>(value.get())->getIdent();
+}
+
+template<typename T> PassRefPtr<MutableStylePropertySet> getPropertiesNotIn(StylePropertySet* styleWithRedundantProperties, T* baseStyle);
 enum LegacyFontSizeMode { AlwaysUseLegacyFontSize, UseLegacyFontSizeOnlyIfPixelValuesMatch };
 static int legacyFontSizeFromCSSValue(Document*, CSSPrimitiveValue*, bool shouldUseFixedFontDefaultSize, LegacyFontSizeMode);
 static bool isTransparentColorValue(CSSValue*);
@@ -323,14 +341,6 @@ EditingStyle::EditingStyle(const StylePropertySet* style)
     extractFontSizeDelta();
 }
 
-EditingStyle::EditingStyle(const CSSStyleDeclaration* style)
-    : m_mutableStyle(style ? style->copyProperties() : 0)
-    , m_shouldUseFixedDefaultFontSize(false)
-    , m_fontSizeDelta(NoFontDelta)
-{
-    extractFontSizeDelta();
-}
-
 EditingStyle::EditingStyle(CSSPropertyID propertyID, const String& value)
     : m_mutableStyle(0)
     , m_shouldUseFixedDefaultFontSize(false)
@@ -357,24 +367,16 @@ static RGBA32 cssValueToRGBA(CSSValue* colorValue)
     return rgba;
 }
 
-static inline RGBA32 getRGBAFontColor(CSSStyleDeclaration* style)
-{
-    return cssValueToRGBA(style->getPropertyCSSValueInternal(CSSPropertyColor).get());
-}
-
-static inline RGBA32 getRGBAFontColor(StylePropertySet* style)
-{
-    return cssValueToRGBA(style->getPropertyCSSValue(CSSPropertyColor).get());
-}
-
-static inline RGBA32 getRGBABackgroundColor(CSSStyleDeclaration* style)
+template<typename T>
+static inline RGBA32 textColorFromStyle(T* style)
 {
-    return cssValueToRGBA(style->getPropertyCSSValueInternal(CSSPropertyBackgroundColor).get());
+    return cssValueToRGBA(extractPropertyValue(style, CSSPropertyColor).get());
 }
 
-static inline RGBA32 getRGBABackgroundColor(StylePropertySet* style)
+template<typename T>
+static inline RGBA32 backgroundColorFromStyle(T* style)
 {
-    return cssValueToRGBA(style->getPropertyCSSValue(CSSPropertyBackgroundColor).get());
+    return cssValueToRGBA(extractPropertyValue(style, CSSPropertyBackgroundColor).get());
 }
 
 static inline RGBA32 rgbaBackgroundColorInEffect(Node* node)
@@ -407,7 +409,7 @@ static int textAlignResolvingStartAndEnd(int textAlign, int direction)
 template<typename T>
 static int textAlignResolvingStartAndEnd(T* style)
 {
-    return textAlignResolvingStartAndEnd(getIdentifierValue(style, CSSPropertyTextAlign), getIdentifierValue(style, CSSPropertyDirection));
+    return textAlignResolvingStartAndEnd(identifierForStyleProperty(style, CSSPropertyTextAlign), identifierForStyleProperty(style, CSSPropertyDirection));
 }
 
 void EditingStyle::init(Node* node, PropertiesToInclude propertiesToInclude)
@@ -417,23 +419,24 @@ void EditingStyle::init(Node* node, PropertiesToInclude propertiesToInclude)
     else if (isTabSpanNode(node))
         node = node->parentNode();
 
-    RefPtr<CSSComputedStyleDeclaration> computedStyleAtPosition = CSSComputedStyleDeclaration::create(node);
-    m_mutableStyle = propertiesToInclude == AllProperties && computedStyleAtPosition ? computedStyleAtPosition->copyProperties() : editingStyleFromComputedStyle(computedStyleAtPosition);
+    ComputedStyleExtractor computedStyleAtPosition(node);
+    m_mutableStyle = propertiesToInclude == AllProperties ? computedStyleAtPosition.copyProperties() : editingStyleFromComputedStyle(node);
 
     if (propertiesToInclude == EditingPropertiesInEffect) {
         if (RefPtr<CSSValue> value = backgroundColorInEffect(node))
             m_mutableStyle->setProperty(CSSPropertyBackgroundColor, value->cssText());
-        if (RefPtr<CSSValue> value = computedStyleAtPosition->getPropertyCSSValue(CSSPropertyWebkitTextDecorationsInEffect))
+        if (RefPtr<CSSValue> value = computedStyleAtPosition.propertyValue(CSSPropertyWebkitTextDecorationsInEffect))
             m_mutableStyle->setProperty(CSSPropertyTextDecoration, value->cssText());
     }
 
     if (node && node->computedStyle()) {
         RenderStyle* renderStyle = node->computedStyle();
         removeTextFillAndStrokeColorsIfNeeded(renderStyle);
-        replaceFontSizeByKeywordIfPossible(renderStyle, computedStyleAtPosition.get());
+        if (renderStyle->fontDescription().keywordSize())
+            m_mutableStyle->setProperty(CSSPropertyFontSize, computedStyleAtPosition.getFontSizeCSSValuePreferringKeyword()->cssText());
     }
 
-    m_shouldUseFixedDefaultFontSize = computedStyleAtPosition->useFixedFontDefaultSize();
+    m_shouldUseFixedDefaultFontSize = computedStyleAtPosition.useFixedFontDefaultSize();
     extractFontSizeDelta();
 }
 
@@ -456,13 +459,6 @@ void EditingStyle::setProperty(CSSPropertyID propertyID, const String& value, bo
     m_mutableStyle->setProperty(propertyID, value, important);
 }
 
-void EditingStyle::replaceFontSizeByKeywordIfPossible(RenderStyle* renderStyle, CSSComputedStyleDeclaration* computedStyle)
-{
-    ASSERT(renderStyle);
-    if (renderStyle->fontDescription().keywordSize())
-        m_mutableStyle->setProperty(CSSPropertyFontSize, computedStyle->getFontSizeCSSValuePreferringKeyword()->cssText());
-}
-
 void EditingStyle::extractFontSizeDelta()
 {
     if (!m_mutableStyle)
@@ -592,8 +588,8 @@ void EditingStyle::removeStyleAddedByNode(Node* node)
 {
     if (!node || !node->parentNode())
         return;
-    RefPtr<MutableStylePropertySet> parentStyle = editingStyleFromComputedStyle(CSSComputedStyleDeclaration::create(node->parentNode()), AllEditingProperties);
-    RefPtr<MutableStylePropertySet> nodeStyle = editingStyleFromComputedStyle(CSSComputedStyleDeclaration::create(node), AllEditingProperties);
+    RefPtr<MutableStylePropertySet> parentStyle = editingStyleFromComputedStyle(node->parentNode(), AllEditingProperties);
+    RefPtr<MutableStylePropertySet> nodeStyle = editingStyleFromComputedStyle(node, AllEditingProperties);
     nodeStyle->removeEquivalentProperties(parentStyle.get());
     m_mutableStyle->removeEquivalentProperties(nodeStyle.get());
 }
@@ -603,8 +599,8 @@ void EditingStyle::removeStyleConflictingWithStyleOfNode(Node* node)
     if (!node || !node->parentNode() || !m_mutableStyle)
         return;
 
-    RefPtr<MutableStylePropertySet> parentStyle = editingStyleFromComputedStyle(CSSComputedStyleDeclaration::create(node->parentNode()), AllEditingProperties);
-    RefPtr<MutableStylePropertySet> nodeStyle = editingStyleFromComputedStyle(CSSComputedStyleDeclaration::create(node), AllEditingProperties);
+    RefPtr<MutableStylePropertySet> parentStyle = editingStyleFromComputedStyle(node->parentNode(), AllEditingProperties);
+    RefPtr<MutableStylePropertySet> nodeStyle = editingStyleFromComputedStyle(node, AllEditingProperties);
     nodeStyle->removeEquivalentProperties(parentStyle.get());
 
     unsigned propertyCount = nodeStyle->propertyCount();
@@ -647,10 +643,11 @@ TriState EditingStyle::triStateOfStyle(EditingStyle* style) const
 {
     if (!style || !style->m_mutableStyle)
         return FalseTriState;
-    return triStateOfStyle(style->m_mutableStyle->ensureCSSStyleDeclaration(), DoNotIgnoreTextOnlyProperties);
+    return triStateOfStyle(style->m_mutableStyle.get(), DoNotIgnoreTextOnlyProperties);
 }
 
-TriState EditingStyle::triStateOfStyle(CSSStyleDeclaration* styleToCompare, ShouldIgnoreTextOnlyProperties shouldIgnoreTextOnlyProperties) const
+template<typename T>
+TriState EditingStyle::triStateOfStyle(T* styleToCompare, ShouldIgnoreTextOnlyProperties shouldIgnoreTextOnlyProperties) const
 {
     RefPtr<MutableStylePropertySet> difference = getPropertiesNotIn(m_mutableStyle.get(), styleToCompare);
 
@@ -675,15 +672,13 @@ TriState EditingStyle::triStateOfStyle(const VisibleSelection& selection) const
 
     TriState state = FalseTriState;
     for (Node* node = selection.start().deprecatedNode(); node; node = NodeTraversal::next(node)) {
-        RefPtr<CSSComputedStyleDeclaration> nodeStyle = CSSComputedStyleDeclaration::create(node);
-        if (nodeStyle) {
-            TriState nodeState = triStateOfStyle(nodeStyle.get(), node->isTextNode() ? EditingStyle::DoNotIgnoreTextOnlyProperties : EditingStyle::IgnoreTextOnlyProperties);
-            if (node == selection.start().deprecatedNode())
-                state = nodeState;
-            else if (state != nodeState && node->isTextNode()) {
-                state = MixedTriState;
-                break;
-            }
+        ComputedStyleExtractor computedStyle(node);
+        TriState nodeState = triStateOfStyle(&computedStyle, node->isTextNode() ? EditingStyle::DoNotIgnoreTextOnlyProperties : EditingStyle::IgnoreTextOnlyProperties);
+        if (node == selection.start().deprecatedNode())
+            state = nodeState;
+        else if (state != nodeState && node->isTextNode()) {
+            state = MixedTriState;
+            break;
         }
         if (node == selection.end().deprecatedNode())
             break;
@@ -847,7 +842,10 @@ bool EditingStyle::extractConflictingImplicitStyleOfAttributes(HTMLElement* elem
 
 bool EditingStyle::styleIsPresentInComputedStyleOfNode(Node* node) const
 {
-    return !m_mutableStyle || getPropertiesNotIn(m_mutableStyle.get(), CSSComputedStyleDeclaration::create(node).get())->isEmpty();
+    if (!m_mutableStyle)
+        return true;
+    ComputedStyleExtractor computedStyle(node);
+    return getPropertiesNotIn(m_mutableStyle.get(), &computedStyle)->isEmpty();
 }
 
 bool EditingStyle::elementIsStyledSpanOrHTMLEquivalent(const HTMLElement* element)
@@ -921,7 +919,7 @@ void EditingStyle::prepareToApplyAt(const Position& position, ShouldPreserveWrit
     if (textAlignResolvingStartAndEnd(m_mutableStyle.get()) == textAlignResolvingStartAndEnd(styleAtPosition))
         m_mutableStyle->removeProperty(CSSPropertyTextAlign);
 
-    if (getRGBAFontColor(m_mutableStyle.get()) == getRGBAFontColor(styleAtPosition))
+    if (textColorFromStyle(m_mutableStyle.get()) == textColorFromStyle(styleAtPosition))
         m_mutableStyle->removeProperty(CSSPropertyColor);
 
     if (hasTransparentBackgroundColor(m_mutableStyle.get())
@@ -1142,7 +1140,7 @@ void EditingStyle::removeStyleFromRulesAndContext(StyledElement* element, Node*
     // 1. Remove style from matched rules because style remain without repeating it in inline style declaration
     RefPtr<MutableStylePropertySet> styleFromMatchedRules = styleFromMatchedRulesForElement(element, StyleResolver::AllButEmptyCSSRules);
     if (styleFromMatchedRules && !styleFromMatchedRules->isEmpty())
-        m_mutableStyle = getPropertiesNotIn(m_mutableStyle.get(), styleFromMatchedRules->ensureCSSStyleDeclaration());
+        m_mutableStyle = getPropertiesNotIn(m_mutableStyle.get(), styleFromMatchedRules.get());
 
     // 2. Remove style present in context and not overriden by matched rules.
     RefPtr<EditingStyle> computedStyle = EditingStyle::create(context, EditingPropertiesInEffect);
@@ -1151,15 +1149,15 @@ void EditingStyle::removeStyleFromRulesAndContext(StyledElement* element, Node*
             computedStyle->m_mutableStyle->setProperty(CSSPropertyBackgroundColor, CSSValueTransparent);
 
         removePropertiesInStyle(computedStyle->m_mutableStyle.get(), styleFromMatchedRules.get());
-        m_mutableStyle = getPropertiesNotIn(m_mutableStyle.get(), computedStyle->m_mutableStyle->ensureCSSStyleDeclaration());
+        m_mutableStyle = getPropertiesNotIn(m_mutableStyle.get(), computedStyle->m_mutableStyle.get());
     }
 
     // 3. If this element is a span and has display: inline or float: none, remove them unless they are overriden by rules.
     // These rules are added by serialization code to wrap text nodes.
     if (isStyleSpanOrSpanWithOnlyStyleAttribute(element)) {
-        if (!styleFromMatchedRules->getPropertyCSSValue(CSSPropertyDisplay) && getIdentifierValue(m_mutableStyle.get(), CSSPropertyDisplay) == CSSValueInline)
+        if (!styleFromMatchedRules->getPropertyCSSValue(CSSPropertyDisplay) && identifierForStyleProperty(m_mutableStyle.get(), CSSPropertyDisplay) == CSSValueInline)
             m_mutableStyle->removeProperty(CSSPropertyDisplay);
-        if (!styleFromMatchedRules->getPropertyCSSValue(CSSPropertyFloat) && getIdentifierValue(m_mutableStyle.get(), CSSPropertyFloat) == CSSValueNone)
+        if (!styleFromMatchedRules->getPropertyCSSValue(CSSPropertyFloat) && identifierForStyleProperty(m_mutableStyle.get(), CSSPropertyFloat) == CSSValueNone)
             m_mutableStyle->removeProperty(CSSPropertyFloat);
     }
 }
@@ -1342,14 +1340,14 @@ StyleChange::StyleChange(EditingStyle* style, const Position& position)
     if (!node)
         return;
 
-    RefPtr<CSSComputedStyleDeclaration> computedStyle = CSSComputedStyleDeclaration::create(node);
+    ComputedStyleExtractor computedStyle(node);
 
     // FIXME: take care of background-color in effect
-    RefPtr<MutableStylePropertySet> mutableStyle = getPropertiesNotIn(style->style(), computedStyle.get());
+    RefPtr<MutableStylePropertySet> mutableStyle = getPropertiesNotIn(style->style(), &computedStyle);
 
     reconcileTextDecorationProperties(mutableStyle.get());
     if (!document->frame()->editor().shouldStyleWithCSS())
-        extractTextStyles(document, mutableStyle.get(), computedStyle->useFixedFontDefaultSize());
+        extractTextStyles(document, mutableStyle.get(), computedStyle.useFixedFontDefaultSize());
 
     // Changing the whitespace style in a tab span would collapse the tab into a space.
     if (isTabSpanTextNode(position.deprecatedNode()) || isTabSpanNode((position.deprecatedNode())))
@@ -1379,12 +1377,12 @@ void StyleChange::extractTextStyles(Document* document, MutableStylePropertySet*
 {
     ASSERT(style);
 
-    if (getIdentifierValue(style, CSSPropertyFontWeight) == CSSValueBold) {
+    if (identifierForStyleProperty(style, CSSPropertyFontWeight) == CSSValueBold) {
         style->removeProperty(CSSPropertyFontWeight);
         m_applyBold = true;
     }
 
-    int fontStyle = getIdentifierValue(style, CSSPropertyFontStyle);
+    int fontStyle = identifierForStyleProperty(style, CSSPropertyFontStyle);
     if (fontStyle == CSSValueItalic || fontStyle == CSSValueOblique) {
         style->removeProperty(CSSPropertyFontStyle);
         m_applyItalic = true;
@@ -1407,7 +1405,7 @@ void StyleChange::extractTextStyles(Document* document, MutableStylePropertySet*
         setTextDecorationProperty(style, newTextDecoration.get(), CSSPropertyTextDecoration);
     }
 
-    int verticalAlign = getIdentifierValue(style, CSSPropertyVerticalAlign);
+    int verticalAlign = identifierForStyleProperty(style, CSSPropertyVerticalAlign);
     switch (verticalAlign) {
     case CSSValueSub:
         style->removeProperty(CSSPropertyVerticalAlign);
@@ -1420,7 +1418,7 @@ void StyleChange::extractTextStyles(Document* document, MutableStylePropertySet*
     }
 
     if (style->getPropertyCSSValue(CSSPropertyColor)) {
-        m_applyFontColor = Color(getRGBAFontColor(style)).serialized();
+        m_applyFontColor = Color(textColorFromStyle(style)).serialized();
         style->removeProperty(CSSPropertyColor);
     }
 
@@ -1484,74 +1482,44 @@ static bool fontWeightIsBold(CSSValue* fontWeight)
     return false;
 }
 
-static bool fontWeightIsBold(CSSStyleDeclaration* style)
-{
-    ASSERT(style);
-    RefPtr<CSSValue> fontWeight = style->getPropertyCSSValueInternal(CSSPropertyFontWeight);
-    return fontWeightIsBold(fontWeight.get());
-}
-
-static bool fontWeightIsBold(StylePropertySet* style)
+template<typename T>
+static bool fontWeightIsBold(T* style)
 {
-    ASSERT(style);
-    RefPtr<CSSValue> fontWeight = style->getPropertyCSSValue(CSSPropertyFontWeight);
-    return fontWeightIsBold(fontWeight.get());
+    return fontWeightIsBold(extractPropertyValue(style, CSSPropertyFontWeight).get());
 }
 
-PassRefPtr<MutableStylePropertySet> getPropertiesNotIn(StylePropertySet* styleWithRedundantProperties, CSSStyleDeclaration* baseStyle)
+template<typename T>
+static PassRefPtr<MutableStylePropertySet> extractPropertiesNotIn(StylePropertySet* styleWithRedundantProperties, T* baseStyle)
 {
     ASSERT(styleWithRedundantProperties);
-    ASSERT(baseStyle);
     RefPtr<MutableStylePropertySet> result = styleWithRedundantProperties->mutableCopy();
 
     result->removeEquivalentProperties(baseStyle);
 
-    RefPtr<CSSValue> baseTextDecorationsInEffect = baseStyle->getPropertyCSSValueInternal(CSSPropertyWebkitTextDecorationsInEffect);
+    RefPtr<CSSValue> baseTextDecorationsInEffect = extractPropertyValue(baseStyle, CSSPropertyWebkitTextDecorationsInEffect);
     diffTextDecorations(result.get(), CSSPropertyTextDecoration, baseTextDecorationsInEffect.get());
     diffTextDecorations(result.get(), CSSPropertyWebkitTextDecorationsInEffect, baseTextDecorationsInEffect.get());
 
-    if (baseStyle->getPropertyCSSValueInternal(CSSPropertyFontWeight) && fontWeightIsBold(result.get()) == fontWeightIsBold(baseStyle))
+    if (extractPropertyValue(baseStyle, CSSPropertyFontWeight) && fontWeightIsBold(result.get()) == fontWeightIsBold(baseStyle))
         result->removeProperty(CSSPropertyFontWeight);
 
-    if (baseStyle->getPropertyCSSValueInternal(CSSPropertyColor) && getRGBAFontColor(result.get()) == getRGBAFontColor(baseStyle))
+    if (extractPropertyValue(baseStyle, CSSPropertyColor) && textColorFromStyle(result.get()) == textColorFromStyle(baseStyle))
         result->removeProperty(CSSPropertyColor);
 
-    if (baseStyle->getPropertyCSSValueInternal(CSSPropertyTextAlign)
+    if (extractPropertyValue(baseStyle, CSSPropertyTextAlign)
         && textAlignResolvingStartAndEnd(result.get()) == textAlignResolvingStartAndEnd(baseStyle))
         result->removeProperty(CSSPropertyTextAlign);
 
-    if (baseStyle->getPropertyCSSValueInternal(CSSPropertyBackgroundColor) && getRGBABackgroundColor(result.get()) == getRGBABackgroundColor(baseStyle))
+    if (extractPropertyValue(baseStyle, CSSPropertyBackgroundColor) && backgroundColorFromStyle(result.get()) == backgroundColorFromStyle(baseStyle))
         result->removeProperty(CSSPropertyBackgroundColor);
 
     return result.release();
 }
 
-int getIdentifierValue(StylePropertySet* style, CSSPropertyID propertyID)
-{
-    if (!style)
-        return 0;
-    RefPtr<CSSValue> value = style->getPropertyCSSValue(propertyID);
-    if (!value || !value->isPrimitiveValue())
-        return 0;
-    return static_cast<CSSPrimitiveValue*>(value.get())->getIdent();
-}
-
-int getIdentifierValue(CSSStyleDeclaration* style, CSSPropertyID propertyID)
-{
-    if (!style)
-        return 0;
-    RefPtr<CSSValue> value = style->getPropertyCSSValueInternal(propertyID);
-    if (!value || !value->isPrimitiveValue())
-        return 0;
-    return static_cast<CSSPrimitiveValue*>(value.get())->getIdent();
-}
-
-int getIdentifierValue(Node* node, CSSPropertyID propertyID)
+template<typename T>
+PassRefPtr<MutableStylePropertySet> getPropertiesNotIn(StylePropertySet* styleWithRedundantProperties, T* baseStyle)
 {
-    RefPtr<CSSValue> value = ComputedStyleExtractor(node).propertyValue(propertyID);
-    if (!value || !value->isPrimitiveValue())
-        return 0;
-    return static_cast<CSSPrimitiveValue*>(value.get())->getIdent();
+    return extractPropertiesNotIn(styleWithRedundantProperties, baseStyle);
 }
 
 static bool isCSSValueLength(CSSPrimitiveValue* value)
@@ -1581,7 +1549,7 @@ int legacyFontSizeFromCSSValue(Document* document, CSSPrimitiveValue* value, boo
 bool isTransparentColorValue(CSSValue* cssValue)
 {
     if (!cssValue)
-        return true;    
+        return true;
     if (!cssValue->isPrimitiveValue())
         return false;
     CSSPrimitiveValue* value = static_cast<CSSPrimitiveValue*>(cssValue);    
index 8bc7f1b..e014519 100644 (file)
@@ -47,7 +47,6 @@ class CSSStyleDeclaration;
 class CSSComputedStyleDeclaration;
 class CSSPrimitiveValue;
 class CSSValue;
-class ComputedStyleExtractor;
 class Document;
 class Element;
 class HTMLElement;
@@ -88,11 +87,6 @@ public:
         return adoptRef(new EditingStyle(style));
     }
 
-    static PassRefPtr<EditingStyle> create(const CSSStyleDeclaration* style)
-    {
-        return adoptRef(new EditingStyle(style));
-    }
-
     static PassRefPtr<EditingStyle> create(CSSPropertyID propertyID, const String& value)
     {
         return adoptRef(new EditingStyle(propertyID, value));
@@ -153,14 +147,13 @@ private:
     EditingStyle(Node*, PropertiesToInclude);
     EditingStyle(const Position&, PropertiesToInclude);
     explicit EditingStyle(const StylePropertySet*);
-    explicit EditingStyle(const CSSStyleDeclaration*);
     EditingStyle(CSSPropertyID, const String& value);
     void init(Node*, PropertiesToInclude);
     void removeTextFillAndStrokeColorsIfNeeded(RenderStyle*);
     void setProperty(CSSPropertyID, const String& value, bool important = false);
-    void replaceFontSizeByKeywordIfPossible(RenderStyle*, CSSComputedStyleDeclaration*);
     void extractFontSizeDelta();
-    TriState triStateOfStyle(CSSStyleDeclaration* styleToCompare, ShouldIgnoreTextOnlyProperties) const;
+    template<typename T>
+    TriState triStateOfStyle(T* styleToCompare, ShouldIgnoreTextOnlyProperties) const;
     bool conflictsWithInlineStyleOfElement(StyledElement*, EditingStyle* extractedStyle, Vector<CSSPropertyID>* conflictingProperties) const;
     void mergeInlineAndImplicitStyleOfElement(StyledElement*, CSSPropertyOverrideMode, PropertiesToInclude);
     void mergeStyle(const StylePropertySet*, CSSPropertyOverrideMode);
@@ -233,11 +226,6 @@ private:
     String m_applyFontSize;
 };
 
-// FIXME: Remove these functions or make them non-global to discourage using CSSStyleDeclaration directly.
-int getIdentifierValue(CSSStyleDeclaration*, CSSPropertyID);
-int getIdentifierValue(StylePropertySet*, CSSPropertyID);
-int getIdentifierValue(Node*, CSSPropertyID);
-
 } // namespace WebCore
 
 #endif // EditingStyle_h