Changeset 148397 in webkit


Ignore:
Timestamp:
Apr 14, 2013 8:46:33 AM (11 years ago)
Author:
akling@apple.com
Message:

Move parseDeclaration() and clear() to MutableStylePropertySet.
<http://webkit.org/b/114583>

Reviewed by Anders Carlsson.

...and remove ASSERT(isMutable()) from the function bodies.

  • svg/SVGFontFaceElement.cpp:

(WebCore::SVGFontFaceElement::removedFrom):

Use clear() directly instead of taking an empty string through the CSS parser.

  • css/StylePropertySet.cpp:

(WebCore::MutableStylePropertySet::parseDeclaration):
(WebCore::MutableStylePropertySet::clear):

  • css/StylePropertySet.h:

(StylePropertySet):
(MutableStylePropertySet):

  • dom/StyledElement.cpp:

(WebCore::StyledElement::setInlineStyleFromString):

Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r148396 r148397  
     12013-04-14  Andreas Kling  <akling@apple.com>
     2
     3        Move parseDeclaration() and clear() to MutableStylePropertySet.
     4        <http://webkit.org/b/114583>
     5
     6        Reviewed by Anders Carlsson.
     7
     8        ...and remove ASSERT(isMutable()) from the function bodies.
     9
     10        * svg/SVGFontFaceElement.cpp:
     11        (WebCore::SVGFontFaceElement::removedFrom):
     12
     13            Use clear() directly instead of taking an empty string through the CSS parser.
     14
     15        * css/StylePropertySet.cpp:
     16        (WebCore::MutableStylePropertySet::parseDeclaration):
     17        (WebCore::MutableStylePropertySet::clear):
     18        * css/StylePropertySet.h:
     19        (StylePropertySet):
     20        (MutableStylePropertySet):
     21        * dom/StyledElement.cpp:
     22        (WebCore::StyledElement::setInlineStyleFromString):
     23
    1242013-04-14  Andreas Kling  <akling@apple.com>
    225
  • trunk/Source/WebCore/css/StylePropertySet.cpp

    r148396 r148397  
    746746}
    747747
    748 void StylePropertySet::parseDeclaration(const String& styleDeclaration, StyleSheetContents* contextStyleSheet)
    749 {
    750     ASSERT(isMutable());
    751 
     748void MutableStylePropertySet::parseDeclaration(const String& styleDeclaration, StyleSheetContents* contextStyleSheet)
     749{
    752750    mutablePropertyVector().clear();
    753751
     
    11041102};
    11051103
    1106 void StylePropertySet::clear()
    1107 {
    1108     ASSERT(isMutable());
     1104void MutableStylePropertySet::clear()
     1105{
    11091106    mutablePropertyVector().clear();
    11101107}
  • trunk/Source/WebCore/css/StylePropertySet.h

    r148396 r148397  
    120120    void removePrefixedOrUnprefixedProperty(CSSPropertyID);
    121121
    122     void parseDeclaration(const String& styleDeclaration, StyleSheetContents* contextStyleSheet);
    123 
    124122    void addParsedProperties(const Vector<CSSProperty>&);
    125123    void addParsedProperty(const CSSProperty&);
    126124
    127     void clear();
    128125    PassRefPtr<StylePropertySet> copyBlockProperties() const;
    129126    void removeBlockProperties();
     
    235232    MutableStylePropertySet(const StylePropertySet&);
    236233
     234    void clear();
     235    void parseDeclaration(const String& styleDeclaration, StyleSheetContents* contextStyleSheet);
     236
    237237    CSSStyleDeclaration* ensureCSSStyleDeclaration();
    238238    CSSStyleDeclaration* ensureInlineCSSStyleDeclaration(const StyledElement* parentElement);
  • trunk/Source/WebCore/dom/StyledElement.cpp

    r148395 r148397  
    194194    if (!inlineStyle)
    195195        inlineStyle = CSSParser::parseInlineStyleDeclaration(newStyleString, this);
    196     else
    197         inlineStyle->parseDeclaration(newStyleString, document()->elementSheet()->contents());
     196    else {
     197        ASSERT(inlineStyle->isMutable());
     198        static_pointer_cast<MutableStylePropertySet>(inlineStyle)->parseDeclaration(newStyleString, document()->elementSheet()->contents());
     199    }
    198200}
    199201
  • trunk/Source/WebCore/svg/SVGFontFaceElement.cpp

    r148395 r148397  
    340340        m_fontElement = 0;
    341341        document()->accessSVGExtensions()->unregisterSVGFontFaceElement(this);
    342         m_fontFaceRule->mutableProperties()->parseDeclaration(emptyString(), 0);
     342        m_fontFaceRule->mutableProperties()->clear();
    343343
    344344        document()->styleResolverChanged(DeferRecalcStyle);
Note: See TracChangeset for help on using the changeset viewer.