Changeset 118761 in webkit
- Timestamp:
- May 29, 2012 5:25:07 AM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r118760 r118761 1 2012-05-29 Andreas Kling <kling@webkit.org> 2 3 Give StylePropertySet a proper mutability flag. 4 <http://webkit.org/b/87675> 5 6 Reviewed by Antti Koivisto. 7 8 Add a flag to StylePropertySet that determines whether it's mutable or not. Only objects 9 constructed from the CSS parser (by way of StylePropertySet::adopt()) are made immutable. 10 This is clean-up and prep work for implementing a more efficient storage scheme for immutable 11 StylePropertySets (fixed-size array instead of vector) as the vast majority of them are 12 unlikely to ever mutate during their lifetime. 13 14 Sprinkled ASSERT(isMutable()) all over StylePropertySet to catch any attempts to modify 15 an immutable object. 16 17 Also made properties() const on StyleRule and friends, which brought some additional code 18 churn along with it. 19 20 * css/CSSComputedStyleDeclaration.cpp: 21 (WebCore::CSSComputedStyleDeclaration::copyPropertiesInSet): 22 * css/CSSFontFaceRule.cpp: 23 (WebCore::CSSFontFaceRule::style): 24 (WebCore::CSSFontFaceRule::reattach): 25 * css/CSSFontFaceSrcValue.cpp: 26 (WebCore::CSSFontFaceSrcValue::addSubresourceStyleURLs): 27 * css/CSSFontFaceSrcValue.h: 28 (CSSFontFaceSrcValue): 29 * css/CSSPageRule.cpp: 30 (WebCore::CSSPageRule::style): 31 (WebCore::CSSPageRule::reattach): 32 * css/CSSPrimitiveValue.cpp: 33 (WebCore::CSSPrimitiveValue::addSubresourceStyleURLs): 34 * css/CSSPrimitiveValue.h: 35 (CSSPrimitiveValue): 36 * css/CSSReflectValue.cpp: 37 (WebCore::CSSReflectValue::addSubresourceStyleURLs): 38 * css/CSSReflectValue.h: 39 (CSSReflectValue): 40 * css/CSSStyleRule.cpp: 41 (WebCore::CSSStyleRule::style): 42 (WebCore::CSSStyleRule::reattach): 43 * css/CSSValue.cpp: 44 (WebCore::CSSValue::addSubresourceStyleURLs): 45 * css/CSSValue.h: 46 (CSSValue): 47 * css/CSSValueList.cpp: 48 (WebCore::CSSValueList::addSubresourceStyleURLs): 49 * css/CSSValueList.h: 50 (CSSValueList): 51 * css/StylePropertySet.cpp: 52 (WebCore::StylePropertySet::StylePropertySet): 53 (WebCore::StylePropertySet::setCSSParserMode): 54 (WebCore): 55 (WebCore::StylePropertySet::copyPropertiesFrom): 56 (WebCore::StylePropertySet::removeShorthandProperty): 57 (WebCore::StylePropertySet::removeProperty): 58 (WebCore::StylePropertySet::setProperty): 59 (WebCore::StylePropertySet::parseDeclaration): 60 (WebCore::StylePropertySet::addParsedProperties): 61 (WebCore::StylePropertySet::addParsedProperty): 62 (WebCore::StylePropertySet::merge): 63 (WebCore::StylePropertySet::addSubresourceStyleURLs): 64 (WebCore::StylePropertySet::removePropertiesInSet): 65 (WebCore::StylePropertySet::findPropertyWithId): 66 (WebCore::StylePropertySet::removeEquivalentProperties): 67 (WebCore::StylePropertySet::copyPropertiesInSet): 68 * css/StylePropertySet.h: 69 (WebCore::StylePropertySet::adopt): 70 (WebCore::StylePropertySet::adoptMutable): 71 (StylePropertySet): 72 (WebCore::StylePropertySet::isMutable): 73 * css/StyleResolver.cpp: 74 (WebCore::StyleResolver::addMatchedProperties): 75 (WebCore::StyleResolver::collectMatchingRulesForList): 76 * css/StyleResolver.h: 77 (StyleResolver): 78 * css/StyleRule.cpp: 79 (WebCore::StyleRule::mutableProperties): 80 (WebCore): 81 (WebCore::StyleRulePage::mutableProperties): 82 (WebCore::StyleRuleFontFace::mutableProperties): 83 * css/StyleRule.h: 84 (WebCore::StyleRule::properties): 85 (StyleRule): 86 (WebCore::StyleRuleFontFace::properties): 87 (StyleRuleFontFace): 88 (WebCore::StyleRulePage::properties): 89 (StyleRulePage): 90 * dom/ElementAttributeData.cpp: 91 (WebCore::ElementAttributeData::ensureInlineStyle): 92 (WebCore::ElementAttributeData::updateInlineStyleAvoidingMutation): 93 * editing/EditingStyle.cpp: 94 (WebCore::styleFromMatchedRulesForElement): 95 * svg/SVGFontFaceElement.cpp: 96 (WebCore::SVGFontFaceElement::parseAttribute): 97 (WebCore::SVGFontFaceElement::rebuildFontFace): 98 (WebCore::SVGFontFaceElement::removedFrom): 99 1 100 2012-05-29 Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com> 2 101 -
trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
r118583 r118761 2642 2642 list.append(CSSProperty(set[i], value.release(), false)); 2643 2643 } 2644 return StylePropertySet::adopt (list);2644 return StylePropertySet::adoptMutable(list); 2645 2645 } 2646 2646 -
trunk/Source/WebCore/css/CSSFontFaceRule.cpp
r116291 r118761 43 43 { 44 44 if (!m_propertiesCSSOMWrapper) 45 m_propertiesCSSOMWrapper = StyleRuleCSSStyleDeclaration::create(m_fontFaceRule-> properties(), const_cast<CSSFontFaceRule*>(this));45 m_propertiesCSSOMWrapper = StyleRuleCSSStyleDeclaration::create(m_fontFaceRule->mutableProperties(), const_cast<CSSFontFaceRule*>(this)); 46 46 return m_propertiesCSSOMWrapper.get(); 47 47 } … … 61 61 m_fontFaceRule = rule; 62 62 if (m_propertiesCSSOMWrapper) 63 m_propertiesCSSOMWrapper->reattach(m_fontFaceRule-> properties());63 m_propertiesCSSOMWrapper->reattach(m_fontFaceRule->mutableProperties()); 64 64 } 65 65 -
trunk/Source/WebCore/css/CSSFontFaceSrcValue.cpp
r118336 r118761 74 74 } 75 75 76 void CSSFontFaceSrcValue::addSubresourceStyleURLs(ListHashSet<KURL>& urls, const StyleSheetContents* styleSheet) 76 void CSSFontFaceSrcValue::addSubresourceStyleURLs(ListHashSet<KURL>& urls, const StyleSheetContents* styleSheet) const 77 77 { 78 78 if (!isLocal()) -
trunk/Source/WebCore/css/CSSFontFaceSrcValue.h
r118194 r118761 66 66 String customCssText() const; 67 67 68 void addSubresourceStyleURLs(ListHashSet<KURL>&, const StyleSheetContents*) ;68 void addSubresourceStyleURLs(ListHashSet<KURL>&, const StyleSheetContents*) const; 69 69 70 70 CachedFont* cachedFont(Document*); -
trunk/Source/WebCore/css/CSSPageRule.cpp
r116291 r118761 49 49 { 50 50 if (!m_propertiesCSSOMWrapper) 51 m_propertiesCSSOMWrapper = StyleRuleCSSStyleDeclaration::create(m_pageRule-> properties(), const_cast<CSSPageRule*>(this));51 m_propertiesCSSOMWrapper = StyleRuleCSSStyleDeclaration::create(m_pageRule->mutableProperties(), const_cast<CSSPageRule*>(this)); 52 52 return m_propertiesCSSOMWrapper.get(); 53 53 } … … 93 93 m_pageRule = rule; 94 94 if (m_propertiesCSSOMWrapper) 95 m_propertiesCSSOMWrapper->reattach(m_pageRule-> properties());95 m_propertiesCSSOMWrapper->reattach(m_pageRule->mutableProperties()); 96 96 } 97 97 -
trunk/Source/WebCore/css/CSSPrimitiveValue.cpp
r118336 r118761 1065 1065 } 1066 1066 1067 void CSSPrimitiveValue::addSubresourceStyleURLs(ListHashSet<KURL>& urls, const StyleSheetContents* styleSheet) 1067 void CSSPrimitiveValue::addSubresourceStyleURLs(ListHashSet<KURL>& urls, const StyleSheetContents* styleSheet) const 1068 1068 { 1069 1069 if (m_primitiveUnitType == CSS_URI) -
trunk/Source/WebCore/css/CSSPrimitiveValue.h
r118194 r118761 284 284 bool isQuirkValue() { return m_isQuirkValue; } 285 285 286 void addSubresourceStyleURLs(ListHashSet<KURL>&, const StyleSheetContents*) ;286 void addSubresourceStyleURLs(ListHashSet<KURL>&, const StyleSheetContents*) const; 287 287 288 288 Length viewportPercentageLength(); -
trunk/Source/WebCore/css/CSSReflectValue.cpp
r118194 r118761 60 60 } 61 61 62 void CSSReflectValue::addSubresourceStyleURLs(ListHashSet<KURL>& urls, const StyleSheetContents* styleSheet) 62 void CSSReflectValue::addSubresourceStyleURLs(ListHashSet<KURL>& urls, const StyleSheetContents* styleSheet) const 63 63 { 64 64 if (m_mask) -
trunk/Source/WebCore/css/CSSReflectValue.h
r118194 r118761 50 50 String customCssText() const; 51 51 52 void addSubresourceStyleURLs(ListHashSet<KURL>&, const StyleSheetContents*) ;52 void addSubresourceStyleURLs(ListHashSet<KURL>&, const StyleSheetContents*) const; 53 53 54 54 private: -
trunk/Source/WebCore/css/CSSStyleRule.cpp
r116291 r118761 60 60 CSSStyleDeclaration* CSSStyleRule::style() const 61 61 { 62 if (!m_propertiesCSSOMWrapper) 63 m_propertiesCSSOMWrapper = StyleRuleCSSStyleDeclaration::create(m_styleRule->properties(), const_cast<CSSStyleRule*>(this)); 62 if (!m_propertiesCSSOMWrapper) { 63 m_propertiesCSSOMWrapper = StyleRuleCSSStyleDeclaration::create(m_styleRule->mutableProperties(), const_cast<CSSStyleRule*>(this)); 64 } 64 65 return m_propertiesCSSOMWrapper.get(); 65 66 } … … 124 125 m_styleRule = rule; 125 126 if (m_propertiesCSSOMWrapper) 126 m_propertiesCSSOMWrapper->reattach(m_styleRule-> properties());127 m_propertiesCSSOMWrapper->reattach(m_styleRule->mutableProperties()); 127 128 } 128 129 -
trunk/Source/WebCore/css/CSSValue.cpp
r118194 r118761 100 100 } 101 101 102 void CSSValue::addSubresourceStyleURLs(ListHashSet<KURL>& urls, const StyleSheetContents* styleSheet) 102 void CSSValue::addSubresourceStyleURLs(ListHashSet<KURL>& urls, const StyleSheetContents* styleSheet) const 103 103 { 104 104 // This should get called for internal instances only. … … 106 106 107 107 if (isPrimitiveValue()) 108 static_cast< CSSPrimitiveValue*>(this)->addSubresourceStyleURLs(urls, styleSheet);108 static_cast<const CSSPrimitiveValue*>(this)->addSubresourceStyleURLs(urls, styleSheet); 109 109 else if (isValueList()) 110 static_cast< CSSValueList*>(this)->addSubresourceStyleURLs(urls, styleSheet);110 static_cast<const CSSValueList*>(this)->addSubresourceStyleURLs(urls, styleSheet); 111 111 else if (classType() == FontFaceSrcClass) 112 static_cast< CSSFontFaceSrcValue*>(this)->addSubresourceStyleURLs(urls, styleSheet);112 static_cast<const CSSFontFaceSrcValue*>(this)->addSubresourceStyleURLs(urls, styleSheet); 113 113 else if (classType() == ReflectClass) 114 static_cast< CSSReflectValue*>(this)->addSubresourceStyleURLs(urls, styleSheet);114 static_cast<const CSSReflectValue*>(this)->addSubresourceStyleURLs(urls, styleSheet); 115 115 } 116 116 -
trunk/Source/WebCore/css/CSSValue.h
r118194 r118761 108 108 PassRefPtr<CSSValue> cloneForCSSOM() const; 109 109 110 void addSubresourceStyleURLs(ListHashSet<KURL>&, const StyleSheetContents*) ;110 void addSubresourceStyleURLs(ListHashSet<KURL>&, const StyleSheetContents*) const; 111 111 112 112 protected: -
trunk/Source/WebCore/css/CSSValueList.cpp
r118194 r118761 137 137 } 138 138 139 void CSSValueList::addSubresourceStyleURLs(ListHashSet<KURL>& urls, const StyleSheetContents* styleSheet) 139 void CSSValueList::addSubresourceStyleURLs(ListHashSet<KURL>& urls, const StyleSheetContents* styleSheet) const 140 140 { 141 141 size_t size = m_values.size(); -
trunk/Source/WebCore/css/CSSValueList.h
r118194 r118761 61 61 String customCssText() const; 62 62 63 void addSubresourceStyleURLs(ListHashSet<KURL>&, const StyleSheetContents*) ;63 void addSubresourceStyleURLs(ListHashSet<KURL>&, const StyleSheetContents*) const; 64 64 65 65 PassRefPtr<CSSValueList> cloneForCSSOM() const; -
trunk/Source/WebCore/css/StylePropertySet.cpp
r118583 r118761 54 54 : m_cssParserMode(cssParserMode) 55 55 , m_ownsCSSOMWrapper(false) 56 , m_isMutable(true) 56 57 { 57 58 } … … 60 61 : m_cssParserMode(cssParserMode) 61 62 , m_ownsCSSOMWrapper(false) 63 , m_isMutable(false) 62 64 { 63 65 m_properties.swap(properties); … … 72 74 , m_cssParserMode(o.m_cssParserMode) 73 75 , m_ownsCSSOMWrapper(false) 76 , m_isMutable(true) 74 77 { 75 78 } … … 82 85 } 83 86 87 void StylePropertySet::setCSSParserMode(CSSParserMode cssParserMode) 88 { 89 ASSERT(isMutable()); 90 m_cssParserMode = cssParserMode; 91 } 92 84 93 void StylePropertySet::copyPropertiesFrom(const StylePropertySet& other) 85 94 { 95 ASSERT(isMutable()); 86 96 m_properties = other.m_properties; 87 97 } … … 454 464 bool StylePropertySet::removeShorthandProperty(CSSPropertyID propertyID) 455 465 { 466 ASSERT(isMutable()); 456 467 StylePropertyShorthand shorthand = shorthandForProperty(propertyID); 457 468 if (!shorthand.length()) … … 462 473 bool StylePropertySet::removeProperty(CSSPropertyID propertyID, String* returnText) 463 474 { 475 ASSERT(isMutable()); 464 476 if (removeShorthandProperty(propertyID)) { 465 477 // FIXME: Return an equivalent shorthand when possible. … … 517 529 bool StylePropertySet::setProperty(CSSPropertyID propertyID, const String& value, bool important, StyleSheetContents* contextStyleSheet) 518 530 { 531 ASSERT(isMutable()); 519 532 // Setting the value to an empty string just removes the property in both IE and Gecko. 520 533 // Setting it to null seems to produce less consistent results, but we treat it just the same. … … 531 544 void StylePropertySet::setProperty(CSSPropertyID propertyID, PassRefPtr<CSSValue> prpValue, bool important) 532 545 { 546 ASSERT(isMutable()); 533 547 StylePropertyShorthand shorthand = shorthandForProperty(propertyID); 534 548 if (!shorthand.length()) { … … 546 560 void StylePropertySet::setProperty(const CSSProperty& property, CSSProperty* slot) 547 561 { 562 ASSERT(isMutable()); 548 563 if (!removeShorthandProperty(property.id())) { 549 564 CSSProperty* toReplace = slot ? slot : findPropertyWithId(property.id()); … … 558 573 bool StylePropertySet::setProperty(CSSPropertyID propertyID, int identifier, bool important) 559 574 { 575 ASSERT(isMutable()); 560 576 setProperty(CSSProperty(propertyID, cssValuePool().createIdentifierValue(identifier), important)); 561 577 return true; … … 564 580 void StylePropertySet::parseDeclaration(const String& styleDeclaration, StyleSheetContents* contextStyleSheet) 565 581 { 582 ASSERT(isMutable()); 583 566 584 m_properties.clear(); 567 585 … … 577 595 void StylePropertySet::addParsedProperties(const Vector<CSSProperty>& properties) 578 596 { 597 ASSERT(isMutable()); 579 598 m_properties.reserveCapacity(m_properties.size() + properties.size()); 580 599 for (unsigned i = 0; i < properties.size(); ++i) … … 584 603 void StylePropertySet::addParsedProperty(const CSSProperty& property) 585 604 { 605 ASSERT(isMutable()); 586 606 // Only add properties that have no !important counterpart present 587 607 if (!propertyIsImportant(property.id()) || property.isImportant()) … … 813 833 void StylePropertySet::merge(const StylePropertySet* other, bool argOverridesOnConflict) 814 834 { 835 ASSERT(isMutable()); 815 836 unsigned size = other->m_properties.size(); 816 837 for (unsigned n = 0; n < size; ++n) { … … 826 847 } 827 848 828 void StylePropertySet::addSubresourceStyleURLs(ListHashSet<KURL>& urls, StyleSheetContents* contextStyleSheet) 849 void StylePropertySet::addSubresourceStyleURLs(ListHashSet<KURL>& urls, StyleSheetContents* contextStyleSheet) const 829 850 { 830 851 size_t size = m_properties.size(); … … 875 896 bool StylePropertySet::removePropertiesInSet(const CSSPropertyID* set, unsigned length) 876 897 { 898 ASSERT(isMutable()); 877 899 if (m_properties.isEmpty()) 878 900 return false; … … 913 935 CSSProperty* StylePropertySet::findPropertyWithId(CSSPropertyID propertyID) 914 936 { 937 ASSERT(isMutable()); 915 938 for (int n = m_properties.size() - 1 ; n >= 0; --n) { 916 939 if (propertyID == m_properties[n].id()) … … 928 951 void StylePropertySet::removeEquivalentProperties(const StylePropertySet* style) 929 952 { 953 ASSERT(isMutable()); 930 954 Vector<CSSPropertyID> propertiesToRemove; 931 955 size_t size = m_properties.size(); … … 942 966 void StylePropertySet::removeEquivalentProperties(const CSSStyleDeclaration* style) 943 967 { 968 ASSERT(isMutable()); 944 969 Vector<CSSPropertyID> propertiesToRemove; 945 970 size_t size = m_properties.size(); … … 968 993 list.append(CSSProperty(set[i], value.release(), false)); 969 994 } 970 return StylePropertySet::adopt (list);995 return StylePropertySet::adoptMutable(list); 971 996 } 972 997 -
trunk/Source/WebCore/css/StylePropertySet.h
r118194 r118761 50 50 return adoptRef(new StylePropertySet(cssParserMode)); 51 51 } 52 static PassRefPtr<StylePropertySet> adopt(StylePropertyVector& properties, CSSParserMode cssParserMode = CSSStrictMode)52 static PassRefPtr<StylePropertySet> adopt(StylePropertyVector& properties, CSSParserMode cssParserMode) 53 53 { 54 54 return adoptRef(new StylePropertySet(properties, cssParserMode)); 55 } 56 static PassRefPtr<StylePropertySet> adoptMutable(StylePropertyVector& properties) 57 { 58 RefPtr<StylePropertySet> result = adoptRef(new StylePropertySet(properties, CSSStrictMode)); 59 result->m_isMutable = true; 60 return result.release(); 55 61 } 56 62 … … 88 94 void merge(const StylePropertySet*, bool argOverridesOnConflict = true); 89 95 90 void setCSSParserMode(CSSParserMode cssParserMode) { m_cssParserMode = cssParserMode; }96 void setCSSParserMode(CSSParserMode); 91 97 CSSParserMode cssParserMode() const { return static_cast<CSSParserMode>(m_cssParserMode); } 92 98 93 void addSubresourceStyleURLs(ListHashSet<KURL>&, StyleSheetContents* contextStyleSheet) ;99 void addSubresourceStyleURLs(ListHashSet<KURL>&, StyleSheetContents* contextStyleSheet) const; 94 100 95 101 PassRefPtr<StylePropertySet> copy() const; 102 96 103 // Used by StyledElement::copyNonAttributeProperties(). 97 104 void copyPropertiesFrom(const StylePropertySet&); … … 108 115 CSSStyleDeclaration* ensureCSSStyleDeclaration() const; 109 116 CSSStyleDeclaration* ensureInlineCSSStyleDeclaration(const StyledElement* parentElement) const; 110 111 // FIXME: Expand the concept of mutable/immutable StylePropertySet. 112 bool isMutable() const { return m_ownsCSSOMWrapper; } 117 118 bool isMutable() const { return m_isMutable; } 113 119 114 120 static unsigned averageSizeInBytes(); … … 145 151 unsigned m_cssParserMode : 2; 146 152 mutable unsigned m_ownsCSSOMWrapper : 1; 153 mutable unsigned m_isMutable : 1; 147 154 148 155 friend class PropertySetCSSStyleDeclaration; -
trunk/Source/WebCore/css/StyleResolver.cpp
r118659 r118761 817 817 } 818 818 819 void StyleResolver::addMatchedProperties(MatchResult& matchResult, StylePropertySet* properties, StyleRule* rule, unsigned linkMatchType, bool inRegionRule)819 void StyleResolver::addMatchedProperties(MatchResult& matchResult, const StylePropertySet* properties, StyleRule* rule, unsigned linkMatchType, bool inRegionRule) 820 820 { 821 821 matchResult.matchedProperties.grow(matchResult.matchedProperties.size() + 1); 822 822 MatchedProperties& newProperties = matchResult.matchedProperties.last(); 823 newProperties.properties = properties;823 newProperties.properties = const_cast<StylePropertySet*>(properties); 824 824 newProperties.linkMatchType = linkMatchType; 825 825 newProperties.isInRegionRule = inRegionRule; … … 1052 1052 } 1053 1053 // If the rule has no properties to apply, then ignore it in the non-debug mode. 1054 StylePropertySet* properties = rule->properties();1054 const StylePropertySet* properties = rule->properties(); 1055 1055 if (!properties || (properties->isEmpty() && !options.includeEmptyRules)) { 1056 1056 InspectorInstrumentation::didMatchRule(cookie, false); … … 2912 2912 2913 2913 // If the rule has no properties to apply, then ignore it. 2914 StylePropertySet* properties = rule->properties();2914 const StylePropertySet* properties = rule->properties(); 2915 2915 if (!properties || properties->isEmpty()) 2916 2916 continue; -
trunk/Source/WebCore/css/StyleResolver.h
r118659 r118761 335 335 }; 336 336 337 static void addMatchedProperties(MatchResult&, StylePropertySet* properties, StyleRule* = 0, unsigned linkMatchType = SelectorChecker::MatchAll, bool inRegionRule = false);337 static void addMatchedProperties(MatchResult&, const StylePropertySet* properties, StyleRule* = 0, unsigned linkMatchType = SelectorChecker::MatchAll, bool inRegionRule = false); 338 338 void addElementStyleProperties(MatchResult&, StylePropertySet*, bool isCacheable = true); 339 339 -
trunk/Source/WebCore/css/StyleRule.cpp
r118484 r118761 181 181 } 182 182 183 StylePropertySet* StyleRule::mutableProperties() 184 { 185 if (!m_properties->isMutable()) 186 m_properties = m_properties->copy(); 187 return m_properties.get(); 188 } 189 183 190 void StyleRule::setProperties(PassRefPtr<StylePropertySet> properties) 184 191 { … … 202 209 } 203 210 211 StylePropertySet* StyleRulePage::mutableProperties() 212 { 213 if (!m_properties->isMutable()) 214 m_properties = m_properties->copy(); 215 return m_properties.get(); 216 } 217 204 218 void StyleRulePage::setProperties(PassRefPtr<StylePropertySet> properties) 205 219 { … … 220 234 StyleRuleFontFace::~StyleRuleFontFace() 221 235 { 236 } 237 238 StylePropertySet* StyleRuleFontFace::mutableProperties() 239 { 240 if (!m_properties->isMutable()) 241 m_properties = m_properties->copy(); 242 return m_properties.get(); 222 243 } 223 244 -
trunk/Source/WebCore/css/StyleRule.h
r115379 r118761 95 95 96 96 const CSSSelectorList& selectorList() const { return m_selectorList; } 97 StylePropertySet* properties() const { return m_properties.get(); } 97 const StylePropertySet* properties() const { return m_properties.get(); } 98 StylePropertySet* mutableProperties(); 98 99 99 100 void parserAdoptSelectorVector(Vector<OwnPtr<CSSParserSelector> >& selectors) { m_selectorList.adoptSelectorVector(selectors); } … … 119 120 ~StyleRuleFontFace(); 120 121 121 StylePropertySet* properties() const { return m_properties.get(); } 122 const StylePropertySet* properties() const { return m_properties.get(); } 123 StylePropertySet* mutableProperties(); 122 124 123 125 void setProperties(PassRefPtr<StylePropertySet>); … … 139 141 140 142 const CSSSelector* selector() const { return m_selectorList.first(); } 141 StylePropertySet* properties() const { return m_properties.get(); } 143 const StylePropertySet* properties() const { return m_properties.get(); } 144 StylePropertySet* mutableProperties(); 142 145 143 146 void parserAdoptSelectorVector(Vector<OwnPtr<CSSParserSelector> >& selectors) { m_selectorList.adoptSelectorVector(selectors); } -
trunk/Source/WebCore/dom/ElementAttributeData.cpp
r118194 r118761 137 137 if (!m_inlineStyleDecl) { 138 138 ASSERT(element->isStyledElement()); 139 m_inlineStyleDecl = StylePropertySet::create(); 140 m_inlineStyleDecl->setCSSParserMode(strictToCSSParserMode(element->isHTMLElement() && !element->document()->inQuirksMode())); 139 m_inlineStyleDecl = StylePropertySet::create(strictToCSSParserMode(element->isHTMLElement() && !element->document()->inQuirksMode())); 141 140 } 142 141 return m_inlineStyleDecl.get(); … … 158 157 if (m_inlineStyleDecl && !m_inlineStyleDecl->isMutable()) 159 158 m_inlineStyleDecl.clear(); 160 if (!m_inlineStyleDecl) { 161 m_inlineStyleDecl = StylePropertySet::create(); 162 m_inlineStyleDecl->setCSSParserMode(strictToCSSParserMode(element->isHTMLElement() && !element->document()->inQuirksMode())); 163 } 159 if (!m_inlineStyleDecl) 160 m_inlineStyleDecl = StylePropertySet::create(strictToCSSParserMode(element->isHTMLElement() && !element->document()->inQuirksMode())); 164 161 m_inlineStyleDecl->parseDeclaration(text, element->document()->elementSheet()->contents()); 165 162 } -
trunk/Source/WebCore/editing/EditingStyle.cpp
r117361 r118761 1034 1034 if (matchedRules) { 1035 1035 for (unsigned i = 0; i < matchedRules->length(); i++) { 1036 if (matchedRules->item(i)->type() == CSSRule::STYLE_RULE) { 1037 RefPtr<StylePropertySet> s = static_cast<CSSStyleRule*>(matchedRules->item(i))->styleRule()->properties(); 1038 style->merge(s.get(), true); 1039 } 1036 if (matchedRules->item(i)->type() == CSSRule::STYLE_RULE) 1037 style->merge(static_cast<CSSStyleRule*>(matchedRules->item(i))->styleRule()->properties(), true); 1040 1038 } 1041 1039 } -
trunk/Source/WebCore/svg/SVGFontFaceElement.cpp
r118192 r118761 114 114 CSSPropertyID propId = cssPropertyIdForSVGAttributeName(attribute.name()); 115 115 if (propId > 0) { 116 m_fontFaceRule-> properties()->setProperty(propId, attribute.value(), false);116 m_fontFaceRule->mutableProperties()->setProperty(propId, attribute.value(), false); 117 117 rebuildFontFace(); 118 118 return; … … 298 298 299 299 // Parse in-memory CSS rules 300 m_fontFaceRule-> properties()->addParsedProperty(CSSProperty(CSSPropertySrc, list));300 m_fontFaceRule->mutableProperties()->addParsedProperty(CSSProperty(CSSPropertySrc, list)); 301 301 302 302 if (describesParentFont) { … … 332 332 if (rootParent->inDocument()) { 333 333 document()->accessSVGExtensions()->unregisterSVGFontFaceElement(this); 334 m_fontFaceRule-> properties()->parseDeclaration(emptyString(), 0);334 m_fontFaceRule->mutableProperties()->parseDeclaration(emptyString(), 0); 335 335 336 336 document()->styleResolverChanged(DeferRecalcStyle);
Note: See TracChangeset
for help on using the changeset viewer.