Changeset 148399 in webkit


Ignore:
Timestamp:
Apr 14, 2013 9:21:02 AM (11 years ago)
Author:
akling@apple.com
Message:

CSSParser should return ImmutableStylePropertySets.
<http://webkit.org/b/114585>

Reviewed by Anders Carlsson.

The StylePropertySets created by CSSParser were already immutable.
Let this be reflected in the pointer types returned.

  • css/CSSParser.cpp:

(WebCore::CSSParser::parseInlineStyleDeclaration):
(WebCore::CSSParser::parseDeclaration):
(WebCore::CSSParser::createStylePropertySet):

  • css/CSSParser.h:

(CSSParser):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r148398 r148399  
     12013-04-14  Andreas Kling  <akling@apple.com>
     2
     3        CSSParser should return ImmutableStylePropertySets.
     4        <http://webkit.org/b/114585>
     5
     6        Reviewed by Anders Carlsson.
     7
     8        The StylePropertySets created by CSSParser were already immutable.
     9        Let this be reflected in the pointer types returned.
     10
     11        * css/CSSParser.cpp:
     12        (WebCore::CSSParser::parseInlineStyleDeclaration):
     13        (WebCore::CSSParser::parseDeclaration):
     14        (WebCore::CSSParser::createStylePropertySet):
     15        * css/CSSParser.h:
     16        (CSSParser):
     17
    1182013-04-14  Andreas Kling  <akling@apple.com>
    219
  • trunk/Source/WebCore/css/CSSParser.cpp

    r148398 r148399  
    14321432}
    14331433
    1434 PassRefPtr<StylePropertySet> CSSParser::parseInlineStyleDeclaration(const String& string, Element* element)
     1434PassRefPtr<ImmutableStylePropertySet> CSSParser::parseInlineStyleDeclaration(const String& string, Element* element)
    14351435{
    14361436    CSSParserContext context = element->document()->elementSheet()->contents()->parserContext();
     
    14391439}
    14401440
    1441 PassRefPtr<StylePropertySet> CSSParser::parseDeclaration(const String& string, StyleSheetContents* contextStyleSheet)
     1441PassRefPtr<ImmutableStylePropertySet> CSSParser::parseDeclaration(const String& string, StyleSheetContents* contextStyleSheet)
    14421442{
    14431443    setStyleSheet(contextStyleSheet);
     
    14501450        deleteFontFaceOnlyValues();
    14511451
    1452     RefPtr<StylePropertySet> style = createStylePropertySet();
     1452    RefPtr<ImmutableStylePropertySet> style = createStylePropertySet();
    14531453    clearProperties();
    14541454    return style.release();
     
    15431543}
    15441544
    1545 PassRefPtr<StylePropertySet> CSSParser::createStylePropertySet()
     1545PassRefPtr<ImmutableStylePropertySet> CSSParser::createStylePropertySet()
    15461546{
    15471547    BitArray<numCSSProperties> seenProperties;
  • trunk/Source/WebCore/css/CSSParser.h

    r148227 r148399  
    5555class Document;
    5656class Element;
     57class ImmutableStylePropertySet;
    5758class MediaQueryExp;
    5859class MediaQuerySet;
     
    9899    PassRefPtr<CSSPrimitiveValue> parseValidPrimitive(int ident, CSSParserValue*);
    99100    bool parseDeclaration(StylePropertySet*, const String&, PassRefPtr<CSSRuleSourceData>, StyleSheetContents* contextStyleSheet);
    100     static PassRefPtr<StylePropertySet> parseInlineStyleDeclaration(const String&, Element*);
     101    static PassRefPtr<ImmutableStylePropertySet> parseInlineStyleDeclaration(const String&, Element*);
    101102    PassOwnPtr<MediaQuery> parseMediaQuery(const String&);
    102103
     
    371372    void clearProperties();
    372373
    373     PassRefPtr<StylePropertySet> createStylePropertySet();
     374    PassRefPtr<ImmutableStylePropertySet> createStylePropertySet();
    374375
    375376    CSSParserContext m_context;
     
    547548
    548549    bool parseValue(StylePropertySet*, CSSPropertyID, const String&, bool important, StyleSheetContents* contextStyleSheet);
    549     PassRefPtr<StylePropertySet> parseDeclaration(const String&, StyleSheetContents* contextStyleSheet);
     550    PassRefPtr<ImmutableStylePropertySet> parseDeclaration(const String&, StyleSheetContents* contextStyleSheet);
    550551
    551552    enum SizeParameterType {
Note: See TracChangeset for help on using the changeset viewer.