Changeset 106756 in webkit


Ignore:
Timestamp:
Feb 5, 2012 12:29:38 AM (12 years ago)
Author:
kling@webkit.org
Message:

Kill CSSMappedAttributeDeclaration.
<http://webkit.org/b/77820>

Reviewed by Antti Koivisto.

Replace all use of CSSMappedAttributeDeclaration by StylePropertySet.
Moved the setNeedsStyleRecalc() calls from CSSMappedAttributeDeclaration
to the add/remove-CSS-property helpers in StyledElement.

This removes one step of indirection for attribute styles and reduces
the size of elements that have presentational attributes by one pointer.

  • CMakeLists.txt:
  • GNUmakefile.list.am:
  • Target.pri:
  • WebCore.gypi:
  • WebCore.order:
  • WebCore.vcproj/WebCore.vcproj:
  • WebCore.xcodeproj/project.pbxproj:
  • dom/CSSMappedAttributeDeclaration.cpp: Removed.
  • dom/CSSMappedAttributeDeclaration.h: Removed.
  • dom/DOMAllInOne.cpp:

Remove CSSMappedAttributeDeclaration.{cpp,h}

  • css/CSSParser.h:
  • css/CSSParser.cpp:

(WebCore::parseSimpleLengthValue):

Remove CSSParser::parseMappedAttributeValue(), we now use parseValue()
directly instead. We lose the benefit of caching new CSSValues in the
document's CSSValuePool but this optimization can be added back later.

  • css/CSSStyleSelector.cpp:

(WebCore::CSSStyleSelector::matchAllRules):

  • dom/ElementAttributeData.h:

(ElementAttributeData):

  • dom/NamedNodeMap.cpp:

(WebCore::NamedNodeMap::ensureAttributeStyle):

  • dom/NamedNodeMap.h:

(WebCore::NamedNodeMap::attributeStyle):
(NamedNodeMap):

  • dom/StyledElement.cpp:

(WebCore::StyledElement::removeCSSProperties):
(WebCore::StyledElement::addCSSProperty):
(WebCore::StyledElement::addCSSImageProperty):
(WebCore::StyledElement::addCSSLength):
(WebCore::StyledElement::addCSSColor):

  • dom/StyledElement.h:

(WebCore):
(WebCore::StyledElement::attributeStyle):
(WebCore::StyledElement::ensureAttributeStyle):

  • inspector/InspectorCSSAgent.cpp:

(WebCore::InspectorCSSAgent::buildArrayForAttributeStyles):

Location:
trunk/Source/WebCore
Files:
2 deleted
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/CMakeLists.txt

    r106695 r106756  
    521521    dom/CompositionEvent.cpp
    522522    dom/ContainerNode.cpp
    523     dom/CSSMappedAttributeDeclaration.cpp
    524523    dom/CustomEvent.cpp
    525524    dom/DatasetDOMStringMap.cpp
  • trunk/Source/WebCore/ChangeLog

    r106755 r106756  
     12012-02-05  Andreas Kling  <awesomekling@apple.com>
     2
     3        Kill CSSMappedAttributeDeclaration.
     4        <http://webkit.org/b/77820>
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Replace all use of CSSMappedAttributeDeclaration by StylePropertySet.
     9        Moved the setNeedsStyleRecalc() calls from CSSMappedAttributeDeclaration
     10        to the add/remove-CSS-property helpers in StyledElement.
     11
     12        This removes one step of indirection for attribute styles and reduces
     13        the size of elements that have presentational attributes by one pointer.
     14
     15        * CMakeLists.txt:
     16        * GNUmakefile.list.am:
     17        * Target.pri:
     18        * WebCore.gypi:
     19        * WebCore.order:
     20        * WebCore.vcproj/WebCore.vcproj:
     21        * WebCore.xcodeproj/project.pbxproj:
     22        * dom/CSSMappedAttributeDeclaration.cpp: Removed.
     23        * dom/CSSMappedAttributeDeclaration.h: Removed.
     24        * dom/DOMAllInOne.cpp:
     25
     26            Remove CSSMappedAttributeDeclaration.{cpp,h}
     27
     28        * css/CSSParser.h:
     29        * css/CSSParser.cpp:
     30        (WebCore::parseSimpleLengthValue):
     31
     32            Remove CSSParser::parseMappedAttributeValue(), we now use parseValue()
     33            directly instead. We lose the benefit of caching new CSSValues in the
     34            document's CSSValuePool but this optimization can be added back later.
     35
     36        * css/CSSStyleSelector.cpp:
     37        (WebCore::CSSStyleSelector::matchAllRules):
     38        * dom/ElementAttributeData.h:
     39        (ElementAttributeData):
     40        * dom/NamedNodeMap.cpp:
     41        (WebCore::NamedNodeMap::ensureAttributeStyle):
     42        * dom/NamedNodeMap.h:
     43        (WebCore::NamedNodeMap::attributeStyle):
     44        (NamedNodeMap):
     45        * dom/StyledElement.cpp:
     46        (WebCore::StyledElement::removeCSSProperties):
     47        (WebCore::StyledElement::addCSSProperty):
     48        (WebCore::StyledElement::addCSSImageProperty):
     49        (WebCore::StyledElement::addCSSLength):
     50        (WebCore::StyledElement::addCSSColor):
     51        * dom/StyledElement.h:
     52        (WebCore):
     53        (WebCore::StyledElement::attributeStyle):
     54        (WebCore::StyledElement::ensureAttributeStyle):
     55        * inspector/InspectorCSSAgent.cpp:
     56        (WebCore::InspectorCSSAgent::buildArrayForAttributeStyles):
     57
    1582012-02-05  Ilya Tikhonovsky  <loislo@chromium.org>
    259
  • trunk/Source/WebCore/GNUmakefile.list.am

    r106695 r106756  
    14751475        Source/WebCore/dom/ContainerNode.h \
    14761476        Source/WebCore/dom/CrossThreadTask.h \
    1477         Source/WebCore/dom/CSSMappedAttributeDeclaration.cpp \
    1478         Source/WebCore/dom/CSSMappedAttributeDeclaration.h \
    14791477        Source/WebCore/dom/CustomEvent.cpp \
    14801478        Source/WebCore/dom/CustomEvent.h \
  • trunk/Source/WebCore/Target.pri

    r106695 r106756  
    485485    dom/CompositionEvent.cpp \
    486486    dom/ContainerNode.cpp \
    487     dom/CSSMappedAttributeDeclaration.cpp \
    488487    dom/CustomEvent.cpp \
    489488    dom/DecodedDataDocumentParser.cpp \
     
    15971596    dom/Comment.h \
    15981597    dom/ContainerNode.h \
    1599     dom/CSSMappedAttributeDeclaration.h \
    16001598    dom/CustomEvent.h \
    16011599    dom/default/PlatformMessagePortChannel.h \
  • trunk/Source/WebCore/WebCore.gypi

    r106699 r106756  
    576576            'dom/Attr.h',
    577577            'dom/Attribute.h',
    578             'dom/CSSMappedAttributeDeclaration.h',
    579578            'dom/CharacterData.h',
    580579            'dom/CheckedRadioButtons.h',
     
    49294928            'dom/CDATASection.cpp',
    49304929            'dom/CDATASection.h',
    4931             'dom/CSSMappedAttributeDeclaration.cpp',
    49324930            'dom/CharacterData.cpp',
    49334931            'dom/CheckedRadioButtons.cpp',
  • trunk/Source/WebCore/WebCore.order

    r105502 r106756  
    49164916__ZN7WebCore26CSSMutableStyleDeclaration11setPropertyEiibb
    49174917__ZN7WebCore26CSSMutableStyleDeclaration19setPropertyInternalERKNS_11CSSPropertyEPS1_
    4918 __ZN7WebCore13StyledElement22setMappedAttributeDeclENS_20MappedAttributeEntryERKNS_13QualifiedNameERKN3WTF12AtomicStringEPNS_29CSSMappedAttributeDeclarationE
    49194918__ZN3WTF6VectorIPN7WebCore26CSSMutableStyleDeclarationELm0EE14expandCapacityEm
    49204919__ZN7WebCore11RenderStyle26setHorizontalBorderSpacingEs
     
    53675366__ZN3WTF6VectorINS_6RefPtrIN7WebCore19AccessibilityObjectEEELm0EED1Ev
    53685367__ZN7WebCore16HTMLTableElementD0Ev
    5369 __ZN7WebCore29CSSMappedAttributeDeclarationD0Ev
    53705368__ZN7WebCore13StyledElement25removeMappedAttributeDeclENS_20MappedAttributeEntryERKNS_13QualifiedNameERKN3WTF12AtomicStringE
    53715369__ZN7WebCore26CSSMutableStyleDeclarationD2Ev
     
    79197917__ZN7WebCore23HTMLTableCaptionElementD0Ev
    79207918__ZN7WebCore13StyledElement11addCSSColorEPNS_9AttributeEiRKN3WTF6StringE
    7921 __ZN3WTF9HashTableIN7WebCore18MappedAttributeKeyESt4pairIS2_PNS1_29CSSMappedAttributeDeclarationEENS_18PairFirstExtractorIS6_EENS1_19MappedAttributeHashENS_14PairHashTraitsINS1_24MappedAttributeKeyTraitsENS_10HashTraitsIS5_EEEESB_E16lookupForWritingIS2_NS_22IdentityHashTranslatorIS2_S6_S9_EEEES3_IPS6_bERKT_
    7922 __ZN3WTF9HashTableIN7WebCore18MappedAttributeKeyESt4pairIS2_PNS1_29CSSMappedAttributeDeclarationEENS_18PairFirstExtractorIS6_EENS1_19MappedAttributeHashENS_14PairHashTraitsINS1_24MappedAttributeKeyTraitsENS_10HashTraitsIS5_EEEESB_E3addIS2_S5_NS_17HashMapTranslatorIS6_SE_S9_EEEES3_INS_17HashTableIteratorIS2_S6_S8_S9_SE_SB_EEbERKT_RKT0_
    7923 __ZN3WTF9HashTableIN7WebCore18MappedAttributeKeyESt4pairIS2_PNS1_29CSSMappedAttributeDeclarationEENS_18PairFirstExtractorIS6_EENS1_19MappedAttributeHashENS_14PairHashTraitsINS1_24MappedAttributeKeyTraitsENS_10HashTraitsIS5_EEEESB_E6lookupIS2_NS_22IdentityHashTranslatorIS2_S6_S9_EEEEPS6_RKT_
    7924 __ZN3WTF9HashTableIN7WebCore18MappedAttributeKeyESt4pairIS2_PNS1_29CSSMappedAttributeDeclarationEENS_18PairFirstExtractorIS6_EENS1_19MappedAttributeHashENS_14PairHashTraitsINS1_24MappedAttributeKeyTraitsENS_10HashTraitsIS5_EEEESB_E6rehashEi
    79257919__ZN7WebCore16HTMLStyleElement20parseMappedAttributeEPNS_9AttributeE
    79267920__ZN7WebCore15FontFamilyValueC1ERKN3WTF6StringE
  • trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj

    r106695 r106756  
    4664346643                        </File>
    4664446644                        <File
    46645                                 RelativePath="..\dom\CSSMappedAttributeDeclaration.cpp"
    46646                                 >
    46647                                 <FileConfiguration
    46648                                         Name="Debug|Win32"
    46649                                         ExcludedFromBuild="true"
    46650                                         >
    46651                                         <Tool
    46652                                                 Name="VCCLCompilerTool"
    46653                                         />
    46654                                 </FileConfiguration>
    46655                                 <FileConfiguration
    46656                                         Name="Release|Win32"
    46657                                         ExcludedFromBuild="true"
    46658                                         >
    46659                                         <Tool
    46660                                                 Name="VCCLCompilerTool"
    46661                                         />
    46662                                 </FileConfiguration>
    46663                                 <FileConfiguration
    46664                                         Name="Debug_Cairo_CFLite|Win32"
    46665                                         ExcludedFromBuild="true"
    46666                                         >
    46667                                         <Tool
    46668                                                 Name="VCCLCompilerTool"
    46669                                         />
    46670                                 </FileConfiguration>
    46671                                 <FileConfiguration
    46672                                         Name="Release_Cairo_CFLite|Win32"
    46673                                         ExcludedFromBuild="true"
    46674                                         >
    46675                                         <Tool
    46676                                                 Name="VCCLCompilerTool"
    46677                                         />
    46678                                 </FileConfiguration>
    46679                                 <FileConfiguration
    46680                                         Name="Debug_All|Win32"
    46681                                         ExcludedFromBuild="true"
    46682                                         >
    46683                                         <Tool
    46684                                                 Name="VCCLCompilerTool"
    46685                                         />
    46686                                 </FileConfiguration>
    46687                                 <FileConfiguration
    46688                                         Name="Production|Win32"
    46689                                         ExcludedFromBuild="true"
    46690                                         >
    46691                                         <Tool
    46692                                                 Name="VCCLCompilerTool"
    46693                                         />
    46694                                 </FileConfiguration>
    46695                         </File>
    46696                         <File
    46697                                 RelativePath="..\dom\CSSMappedAttributeDeclaration.h"
    46698                                 >
    46699                         </File>
    46700                         <File
    4670146645                                RelativePath="..\dom\CustomEvent.cpp"
    4670246646                                >
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r106723 r106756  
    39733973                A8C4A80709D563270003AC8D /* Element.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C4A7F509D563270003AC8D /* Element.h */; settings = {ATTRIBUTES = (Private, ); }; };
    39743974                A8C4A80809D563270003AC8D /* Element.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8C4A7F609D563270003AC8D /* Element.cpp */; };
    3975                 A8C4A80909D563270003AC8D /* CSSMappedAttributeDeclaration.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C4A7F709D563270003AC8D /* CSSMappedAttributeDeclaration.h */; settings = {ATTRIBUTES = (Private, ); }; };
    3976                 A8C4A80A09D563270003AC8D /* CSSMappedAttributeDeclaration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8C4A7F809D563270003AC8D /* CSSMappedAttributeDeclaration.cpp */; };
    39773975                A8C4A80B09D563270003AC8D /* Attribute.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C4A7F909D563270003AC8D /* Attribute.h */; settings = {ATTRIBUTES = (Private, ); }; };
    39783976                A8C4A80C09D563270003AC8D /* Attribute.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8C4A7FA09D563270003AC8D /* Attribute.cpp */; };
     
    1069410692                A8C4A7F509D563270003AC8D /* Element.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Element.h; sourceTree = "<group>"; };
    1069510693                A8C4A7F609D563270003AC8D /* Element.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Element.cpp; sourceTree = "<group>"; };
    10696                 A8C4A7F709D563270003AC8D /* CSSMappedAttributeDeclaration.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CSSMappedAttributeDeclaration.h; sourceTree = "<group>"; };
    10697                 A8C4A7F809D563270003AC8D /* CSSMappedAttributeDeclaration.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CSSMappedAttributeDeclaration.cpp; sourceTree = "<group>"; };
    1069810694                A8C4A7F909D563270003AC8D /* Attribute.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Attribute.h; sourceTree = "<group>"; };
    1069910695                A8C4A7FA09D563270003AC8D /* Attribute.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Attribute.cpp; sourceTree = "<group>"; };
     
    2040720403                                E1A1470711102B1500EEC0F3 /* ContainerNodeAlgorithms.h */,
    2040820404                                2E3FAA0811A36BF100576624 /* CrossThreadTask.h */,
    20409                                 A8C4A7F809D563270003AC8D /* CSSMappedAttributeDeclaration.cpp */,
    20410                                 A8C4A7F709D563270003AC8D /* CSSMappedAttributeDeclaration.h */,
    2041120405                                62CD32561157E57C0063B0A7 /* CustomEvent.cpp */,
    2041220406                                62CD32571157E57C0063B0A7 /* CustomEvent.h */,
     
    2129121285                                A80E6D080A1989CA007FB8C5 /* CSSInitialValue.h in Headers */,
    2129221286                                BC772E131331620C001EC9CE /* CSSLineBoxContainValue.h in Headers */,
    21293                                 A8C4A80909D563270003AC8D /* CSSMappedAttributeDeclaration.h in Headers */,
    2129421287                                A80E6D030A1989CA007FB8C5 /* CSSMediaRule.h in Headers */,
    2129521288                                A80E6DFC0A199067007FB8C5 /* StylePropertySet.h in Headers */,
     
    2469624689                                A80E6D020A1989CA007FB8C5 /* CSSInitialValue.cpp in Sources */,
    2469724690                                BC772E16133162C2001EC9CE /* CSSLineBoxContainValue.cpp in Sources */,
    24698                                 A8C4A80A09D563270003AC8D /* CSSMappedAttributeDeclaration.cpp in Sources */,
    2469924691                                A80E6CFC0A1989CA007FB8C5 /* CSSMediaRule.cpp in Sources */,
    2470024692                                A80E6DFB0A199067007FB8C5 /* StylePropertySet.cpp in Sources */,
  • trunk/Source/WebCore/css/CSSParser.cpp

    r106695 r106756  
    410410}
    411411
    412 static bool parseSimpleLengthValue(StylePropertySet* 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)
    413413{
    414414    bool acceptsNegativeNumbers;
     
    474474        return false;
    475475
    476     CSSStyleSheet* styleSheet = contextStyleSheet ? contextStyleSheet : declaration->contextStyleSheet();
     476    CSSStyleSheet* styleSheet = declaration->contextStyleSheet();
    477477    if (!styleSheet)
    478478        return false;
     
    483483    declaration->addParsedProperty(property);
    484484    return true;
    485 }
    486 
    487 bool CSSParser::parseMappedAttributeValue(CSSMappedAttributeDeclaration* mappedAttribute, StyledElement* element, int propertyId, const String& value)
    488 {
    489     ASSERT(mappedAttribute);
    490     ASSERT(element);
    491     ASSERT(element->document());
    492     CSSStyleSheet* elementSheet = element->document()->elementSheet();
    493     if (parseSimpleLengthValue(mappedAttribute->declaration(), propertyId, value, false, false, elementSheet))
    494         return true;
    495     if (parseColorValue(mappedAttribute->declaration(), propertyId, value, false, false, elementSheet))
    496         return true;
    497     CSSParser parser(false);
    498     return parser.parseValue(mappedAttribute->declaration(), propertyId, value, false, elementSheet);
    499485}
    500486
  • trunk/Source/WebCore/css/CSSParser.h

    r106681 r106756  
    4444
    4545class CSSBorderImageSliceValue;
    46 class CSSMappedAttributeDeclaration;
    4746class CSSPrimitiveValue;
    4847class CSSValuePool;
     
    7776    bool parseDeclaration(StylePropertySet*, const String&, RefPtr<CSSStyleSourceData>* = 0, CSSStyleSheet* contextStyleSheet = 0);
    7877    bool parseMediaQuery(MediaList*, const String&);
    79 
    80     static bool parseMappedAttributeValue(CSSMappedAttributeDeclaration*, StyledElement*, int propertyId, const String&);
    8178
    8279    Document* findDocument() const;
  • trunk/Source/WebCore/css/CSSStyleSelector.cpp

    r106741 r106756  
    997997    // Now check author rules, beginning first with presentational attributes mapped from HTML.
    998998    if (m_styledElement) {
    999         if (CSSMappedAttributeDeclaration* attributeStyle = m_styledElement->attributeStyle()) {
    1000             ASSERT(attributeStyle->declaration());
    1001             if (!attributeStyle->declaration()->isEmpty()) {
     999        if (StylePropertySet* attributeStyle = m_styledElement->attributeStyle()) {
     1000            if (!attributeStyle->isEmpty()) {
    10021001                result.ranges.lastAuthorRule = m_matchedRules.size();
    10031002                if (result.ranges.firstAuthorRule == -1)
    10041003                    result.ranges.firstAuthorRule = result.ranges.lastAuthorRule;
    1005                 addMatchedDeclaration(attributeStyle->declaration());
     1004                addMatchedDeclaration(attributeStyle);
    10061005                result.isCacheable = false;
    10071006            }
  • trunk/Source/WebCore/dom/DOMAllInOne.cpp

    r106323 r106756  
    3232#include "BeforeUnloadEvent.cpp"
    3333#include "CDATASection.cpp"
    34 #include "CSSMappedAttributeDeclaration.cpp"
    3534#include "CharacterData.cpp"
    3635#include "CheckedRadioButtons.cpp"
  • trunk/Source/WebCore/dom/ElementAttributeData.h

    r106740 r106756  
    2727#define ElementAttributeData_h
    2828
    29 #include "CSSMappedAttributeDeclaration.h"
    3029#include "SpaceSplitString.h"
    3130#include "StylePropertySet.h"
     
    5251
    5352    RefPtr<StylePropertySet> m_inlineStyleDecl;
    54     RefPtr<CSSMappedAttributeDeclaration> m_attributeStyle;
     53    RefPtr<StylePropertySet> m_attributeStyle;
    5554    SpaceSplitString m_classNames;
    5655    AtomicString m_idForStyleResolution;
  • trunk/Source/WebCore/dom/NamedNodeMap.cpp

    r106746 r106756  
    337337}
    338338
    339 CSSMappedAttributeDeclaration* NamedNodeMap::ensureAttributeStyle()
     339StylePropertySet* NamedNodeMap::ensureAttributeStyle()
    340340{
    341341    if (!attributeData()->m_attributeStyle) {
    342         attributeData()->m_attributeStyle = CSSMappedAttributeDeclaration::create();
    343         attributeData()->m_attributeStyle->declaration()->setStrictParsing(false);
     342        attributeData()->m_attributeStyle = StylePropertySet::create();
     343        attributeData()->m_attributeStyle->setStrictParsing(false);
    344344    }
    345345    return attributeData()->m_attributeStyle.get();
  • trunk/Source/WebCore/dom/NamedNodeMap.h

    r106740 r106756  
    2727
    2828#include "Attribute.h"
    29 #include "CSSMappedAttributeDeclaration.h"
    3029#include "CSSPropertyNames.h"
    3130#include "ElementAttributeData.h"
     
    106105    void destroyInlineStyleDecl();
    107106
    108     CSSMappedAttributeDeclaration* attributeStyle() const { return attributeData()->m_attributeStyle.get(); }
    109     CSSMappedAttributeDeclaration* ensureAttributeStyle();
     107    StylePropertySet* attributeStyle() const { return attributeData()->m_attributeStyle.get(); }
     108    StylePropertySet* ensureAttributeStyle();
    110109
    111110private:
  • trunk/Source/WebCore/dom/StyledElement.cpp

    r106746 r106756  
    2626
    2727#include "Attribute.h"
     28#include "CSSImageValue.h"
    2829#include "CSSStyleSelector.h"
    2930#include "CSSStyleSheet.h"
     
    122123void StyledElement::removeCSSProperties(int id1, int id2, int id3, int id4, int id5, int id6, int id7, int id8)
    123124{
    124     CSSMappedAttributeDeclaration* style = attributeStyle();
     125    StylePropertySet* style = attributeStyle();
    125126    if (!style)
    126127        return;
    127128
     129    setNeedsStyleRecalc(FullStyleChange);
     130
    128131    ASSERT(id1 != CSSPropertyInvalid);
    129     style->removeMappedProperty(this, id1);
     132    style->removeProperty(id1);
    130133
    131134    if (id2 == CSSPropertyInvalid)
    132135        return;
    133     style->removeMappedProperty(this, id2);
     136    style->removeProperty(id2);
    134137    if (id3 == CSSPropertyInvalid)
    135138        return;
    136     style->removeMappedProperty(this, id3);
     139    style->removeProperty(id3);
    137140    if (id4 == CSSPropertyInvalid)
    138141        return;
    139     style->removeMappedProperty(this, id4);
     142    style->removeProperty(id4);
    140143    if (id5 == CSSPropertyInvalid)
    141144        return;
    142     style->removeMappedProperty(this, id5);
     145    style->removeProperty(id5);
    143146    if (id6 == CSSPropertyInvalid)
    144147        return;
    145     style->removeMappedProperty(this, id6);
     148    style->removeProperty(id6);
    146149    if (id7 == CSSPropertyInvalid)
    147150        return;
    148     style->removeMappedProperty(this, id7);
     151    style->removeProperty(id7);
    149152    if (id8 == CSSPropertyInvalid)
    150153        return;
    151     style->removeMappedProperty(this, id8);
     154    style->removeProperty(id8);
    152155}
    153156
    154157void StyledElement::addCSSProperty(int id, const String &value)
    155158{
    156     ensureAttributeStyle()->setMappedProperty(this, id, value);
     159    if (!ensureAttributeStyle()->setProperty(id, value))
     160        removeCSSProperty(id);
     161    else
     162        setNeedsStyleRecalc(FullStyleChange);
    157163}
    158164
    159165void StyledElement::addCSSProperty(int id, int value)
    160166{
    161     ensureAttributeStyle()->setMappedProperty(this, id, value);
     167    ensureAttributeStyle()->setProperty(id, value);
     168    setNeedsStyleRecalc(FullStyleChange);
    162169}
    163170
    164171void StyledElement::addCSSImageProperty(int id, const String& url)
    165172{
    166     ensureAttributeStyle()->setMappedImageProperty(this, id, url);
     173    ensureAttributeStyle()->setProperty(CSSProperty(id, CSSImageValue::create(url)));
     174    setNeedsStyleRecalc(FullStyleChange);
    167175}
    168176
     
    193201
    194202        if (l != v->length()) {
    195             ensureAttributeStyle()->setMappedLengthProperty(this, id, v->substring(0, l));
     203            addCSSProperty(id, v->substring(0, l));
    196204            return;
    197205        }
    198206    }
    199207
    200     ensureAttributeStyle()->setMappedLengthProperty(this, id, value);
     208    addCSSProperty(id, value);
    201209}
    202210
     
    273281    Color parsedColor(colorString);
    274282    if (parsedColor.isValid()) {
    275         ensureAttributeStyle()->setMappedProperty(this, id, colorString);
    276         return;
    277     }
    278 
    279     ensureAttributeStyle()->setMappedProperty(this, id, parseColorStringWithCrazyLegacyRules(colorString));
     283        addCSSProperty(id, colorString);
     284        return;
     285    }
     286
     287    addCSSProperty(id, parseColorStringWithCrazyLegacyRules(colorString));
    280288}
    281289
  • trunk/Source/WebCore/dom/StyledElement.h

    r106746 r106756  
    3333
    3434class Attribute;
    35 class CSSMappedAttributeDeclaration;
    3635
    3736class StyledElement : public Element {
     
    5655    virtual CSSStyleDeclaration* style() OVERRIDE { return ensureInlineStyleDecl()->ensureCSSStyleDeclaration(); }
    5756
    58     CSSMappedAttributeDeclaration* attributeStyle() const { return attributeMap() ? attributeMap()->attributeStyle() : 0; }
    59     CSSMappedAttributeDeclaration* ensureAttributeStyle() { return ensureAttributeMap()->ensureAttributeStyle(); }
     57    StylePropertySet* attributeStyle() const { return attributeMap() ? attributeMap()->attributeStyle() : 0; }
     58    StylePropertySet* ensureAttributeStyle() { return ensureAttributeMap()->ensureAttributeStyle(); }
    6059
    6160    const SpaceSplitString& classNames() const;
  • trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp

    r106740 r106756  
    723723        return InspectorArray::create();
    724724
    725     CSSMappedAttributeDeclaration* attributeStyle = static_cast<StyledElement*>(element)->attributeStyle();
    726     if (!attributeStyle || !attributeStyle->declaration())
     725    StylePropertySet* attributeStyle = static_cast<StyledElement*>(element)->attributeStyle();
     726    if (!attributeStyle)
    727727        return InspectorArray::create();
    728728
    729729    RefPtr<InspectorObject> attrStyleObject = InspectorObject::create();
    730     RefPtr<InspectorStyle> inspectorStyle = InspectorStyle::create(InspectorCSSId(), attributeStyle->declaration()->ensureCSSStyleDeclaration(), 0);
     730    RefPtr<InspectorStyle> inspectorStyle = InspectorStyle::create(InspectorCSSId(), attributeStyle->ensureCSSStyleDeclaration(), 0);
    731731    attrStyleObject->setString("name", "");
    732732    attrStyleObject->setObject("style", inspectorStyle->buildObjectForStyle());
Note: See TracChangeset for help on using the changeset viewer.