Changeset 148400 in webkit
- Timestamp:
- Apr 14, 2013 9:43:35 AM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r148399 r148400 1 2013-04-14 Andreas Kling <akling@apple.com> 2 3 Move addParsedProperty/addParsedProperties to MutableStylePropertySet. 4 <http://webkit.org/b/114587> 5 6 Reviewed by Antti Koivisto. 7 8 All CSSParser methods that mutate an existing StylePropertySet now take a MutableStylePropertySet* 9 instead of a StylePropertySet*. 10 11 * css/CSSParser.cpp: 12 (WebCore::parseColorValue): 13 (WebCore::parseSimpleLengthValue): 14 (WebCore::parseKeywordValue): 15 (WebCore::parseTranslateTransformValue): 16 (WebCore::CSSParser::parseValue): 17 (WebCore::CSSParser::parseDeclaration): 18 * css/CSSParser.h: 19 (CSSParser): 20 * css/StylePropertySet.cpp: 21 (WebCore::StylePropertySet::setProperty): 22 (WebCore::MutableStylePropertySet::addParsedProperties): 23 (WebCore::MutableStylePropertySet::addParsedProperty): 24 * css/StylePropertySet.h: 25 (StylePropertySet): 26 (MutableStylePropertySet): 27 * css/ViewportStyleResolver.h: 28 (ViewportStyleResolver): 29 1 30 2013-04-14 Andreas Kling <akling@apple.com> 2 31 -
trunk/Source/WebCore/css/CSSParser.cpp
r148399 r148400 536 536 } 537 537 538 static bool parseColorValue( StylePropertySet* declaration, CSSPropertyID propertyId, const String& string, bool important, CSSParserMode cssParserMode)538 static bool parseColorValue(MutableStylePropertySet* declaration, CSSPropertyID propertyId, const String& string, bool important, CSSParserMode cssParserMode) 539 539 { 540 540 ASSERT(!string.isEmpty()); … … 634 634 } 635 635 636 static bool parseSimpleLengthValue( StylePropertySet* declaration, CSSPropertyID propertyId, const String& string, bool important, CSSParserMode cssParserMode)636 static bool parseSimpleLengthValue(MutableStylePropertySet* declaration, CSSPropertyID propertyId, const String& string, bool important, CSSParserMode cssParserMode) 637 637 { 638 638 ASSERT(!string.isEmpty()); … … 1190 1190 } 1191 1191 1192 static bool parseKeywordValue( StylePropertySet* declaration, CSSPropertyID propertyId, const String& string, bool important, const CSSParserContext& parserContext)1192 static bool parseKeywordValue(MutableStylePropertySet* declaration, CSSPropertyID propertyId, const String& string, bool important, const CSSParserContext& parserContext) 1193 1193 { 1194 1194 ASSERT(!string.isEmpty()); … … 1247 1247 } 1248 1248 1249 static bool parseTranslateTransformValue( StylePropertySet* properties, CSSPropertyID propertyID, const String& string, bool important)1249 static bool parseTranslateTransformValue(MutableStylePropertySet* properties, CSSPropertyID propertyID, const String& string, bool important) 1250 1250 { 1251 1251 if (propertyID != CSSPropertyWebkitTransform) … … 1305 1305 1306 1306 #if ENABLE(CSS_VARIABLES) 1307 bool CSSParser::parseValue( StylePropertySet* declaration, CSSPropertyID propertyID, const String& string, bool important, Document* document)1307 bool CSSParser::parseValue(MutableStylePropertySet* declaration, CSSPropertyID propertyID, const String& string, bool important, Document* document) 1308 1308 { 1309 1309 ASSERT(!string.isEmpty()); … … 1323 1323 #endif 1324 1324 1325 bool CSSParser::parseValue( StylePropertySet* declaration, CSSPropertyID propertyID, const String& string, bool important, CSSParserMode cssParserMode, StyleSheetContents* contextStyleSheet)1325 bool CSSParser::parseValue(MutableStylePropertySet* declaration, CSSPropertyID propertyID, const String& string, bool important, CSSParserMode cssParserMode, StyleSheetContents* contextStyleSheet) 1326 1326 { 1327 1327 ASSERT(!string.isEmpty()); … … 1346 1346 } 1347 1347 1348 bool CSSParser::parseValue( StylePropertySet* declaration, CSSPropertyID propertyID, const String& string, bool important, StyleSheetContents* contextStyleSheet)1348 bool CSSParser::parseValue(MutableStylePropertySet* declaration, CSSPropertyID propertyID, const String& string, bool important, StyleSheetContents* contextStyleSheet) 1349 1349 { 1350 1350 setStyleSheet(contextStyleSheet); … … 1456 1456 1457 1457 1458 bool CSSParser::parseDeclaration( StylePropertySet* declaration, const String& string, PassRefPtr<CSSRuleSourceData> prpRuleSourceData, StyleSheetContents* contextStyleSheet)1458 bool CSSParser::parseDeclaration(MutableStylePropertySet* declaration, const String& string, PassRefPtr<CSSRuleSourceData> prpRuleSourceData, StyleSheetContents* contextStyleSheet) 1459 1459 { 1460 1460 // Length of the "@-webkit-decls{" prefix. -
trunk/Source/WebCore/css/CSSParser.h
r148399 r148400 58 58 class MediaQueryExp; 59 59 class MediaQuerySet; 60 class MutableStylePropertySet; 60 61 class StyleKeyframe; 61 class StylePropertySet;62 62 class StylePropertyShorthand; 63 63 class StyleRuleBase; … … 93 93 bool parseSupportsCondition(const String&); 94 94 #endif 95 static bool parseValue( StylePropertySet*, CSSPropertyID, const String&, bool important, CSSParserMode, StyleSheetContents*);95 static bool parseValue(MutableStylePropertySet*, CSSPropertyID, const String&, bool important, CSSParserMode, StyleSheetContents*); 96 96 static bool parseColor(RGBA32& color, const String&, bool strict = false); 97 97 static bool parseSystemColor(RGBA32& color, const String&, Document*); 98 98 static PassRefPtr<CSSValueList> parseFontFaceValue(const AtomicString&); 99 99 PassRefPtr<CSSPrimitiveValue> parseValidPrimitive(int ident, CSSParserValue*); 100 bool parseDeclaration( StylePropertySet*, const String&, PassRefPtr<CSSRuleSourceData>, StyleSheetContents* contextStyleSheet);100 bool parseDeclaration(MutableStylePropertySet*, const String&, PassRefPtr<CSSRuleSourceData>, StyleSheetContents* contextStyleSheet); 101 101 static PassRefPtr<ImmutableStylePropertySet> parseInlineStyleDeclaration(const String&, Element*); 102 102 PassOwnPtr<MediaQuery> parseMediaQuery(const String&); … … 115 115 116 116 #if ENABLE(CSS_VARIABLES) 117 static bool parseValue( StylePropertySet*, CSSPropertyID, const String&, bool important, Document*);117 static bool parseValue(MutableStylePropertySet*, CSSPropertyID, const String&, bool important, Document*); 118 118 bool cssVariablesEnabled() const; 119 119 void storeVariableDeclaration(const CSSParserString&, PassOwnPtr<CSSParserValueList>, bool important); … … 547 547 bool parseGeneratedImage(CSSParserValueList*, RefPtr<CSSValue>&); 548 548 549 bool parseValue( StylePropertySet*, CSSPropertyID, const String&, bool important, StyleSheetContents* contextStyleSheet);549 bool parseValue(MutableStylePropertySet*, CSSPropertyID, const String&, bool important, StyleSheetContents* contextStyleSheet); 550 550 PassRefPtr<ImmutableStylePropertySet> parseDeclaration(const String&, StyleSheetContents* contextStyleSheet); 551 551 -
trunk/Source/WebCore/css/StylePropertySet.cpp
r148398 r148400 689 689 // When replacing an existing property value, this moves the property to the end of the list. 690 690 // Firefox preserves the position, and MSIE moves the property to the beginning. 691 return CSSParser::parseValue( this, propertyID, value, important, cssParserMode(), contextStyleSheet);691 return CSSParser::parseValue(static_cast<MutableStylePropertySet*>(this), propertyID, value, important, cssParserMode(), contextStyleSheet); 692 692 } 693 693 … … 759 759 } 760 760 761 void StylePropertySet::addParsedProperties(const Vector<CSSProperty>& properties) 762 { 763 ASSERT(isMutable()); 761 void MutableStylePropertySet::addParsedProperties(const Vector<CSSProperty>& properties) 762 { 764 763 mutablePropertyVector().reserveCapacity(mutablePropertyVector().size() + properties.size()); 765 764 for (unsigned i = 0; i < properties.size(); ++i) … … 767 766 } 768 767 769 void StylePropertySet::addParsedProperty(const CSSProperty& property) 770 { 771 ASSERT(isMutable()); 768 void MutableStylePropertySet::addParsedProperty(const CSSProperty& property) 769 { 772 770 // Only add properties that have no !important counterpart present 773 771 if (!propertyIsImportant(property.id()) || property.isImportant()) -
trunk/Source/WebCore/css/StylePropertySet.h
r148398 r148400 118 118 void removePrefixedOrUnprefixedProperty(CSSPropertyID); 119 119 120 void addParsedProperties(const Vector<CSSProperty>&);121 void addParsedProperty(const CSSProperty&);122 123 120 PassRefPtr<StylePropertySet> copyBlockProperties() const; 124 121 void removeBlockProperties(); … … 233 230 MutableStylePropertySet(const StylePropertySet&); 234 231 232 void addParsedProperties(const Vector<CSSProperty>&); 233 void addParsedProperty(const CSSProperty&); 234 235 235 void clear(); 236 236 void parseDeclaration(const String& styleDeclaration, StyleSheetContents* contextStyleSheet); -
trunk/Source/WebCore/css/ViewportStyleResolver.h
r143926 r148400 42 42 class CSSPrimitiveValue; 43 43 class Document; 44 class MutableStylePropertySet; 44 45 class StyleRuleViewport; 45 class StylePropertySet;46 46 47 47 class ViewportStyleResolver : public RefCounted<ViewportStyleResolver> { … … 65 65 66 66 Document* m_document; 67 RefPtr< StylePropertySet> m_propertySet;67 RefPtr<MutableStylePropertySet> m_propertySet; 68 68 }; 69 69
Note: See TracChangeset
for help on using the changeset viewer.