Changeset 148402 in webkit
- Timestamp:
- Apr 14, 2013 10:33:13 AM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r148400 r148402 1 2013-04-14 Andreas Kling <akling@apple.com> 2 3 EditingStyle should have a MutableStylePropertySet internally. 4 <http://webkit.org/b/114588> 5 6 Reviewed by Anders Carlsson. 7 8 Switch EditingStyle::m_mutableStyle to a RefPtr<MutableStylePropertySet>. 9 10 * css/StylePropertySet.cpp: 11 (WebCore::StylePropertySet::copyBlockProperties): 12 * css/StylePropertySet.h: 13 (StylePropertySet): 14 * editing/EditingStyle.cpp: 15 (WebCore::EditingStyle::setStyle): 16 (WebCore::EditingStyle::mergeStyleFromRules): 17 (WebCore::StyleChange::StyleChange): 18 (WebCore::setTextDecorationProperty): 19 (WebCore::StyleChange::extractTextStyles): 20 (WebCore::diffTextDecorations): 21 (WebCore::getPropertiesNotIn): 22 * editing/EditingStyle.h: 23 (WebCore::EditingStyle::style): 24 (EditingStyle): 25 (StyleChange): 26 1 27 2013-04-14 Andreas Kling <akling@apple.com> 2 28 -
trunk/Source/WebCore/css/StylePropertySet.cpp
r148400 r148402 1107 1107 const unsigned numBlockProperties = WTF_ARRAY_LENGTH(blockProperties); 1108 1108 1109 PassRefPtr< StylePropertySet> StylePropertySet::copyBlockProperties() const1109 PassRefPtr<MutableStylePropertySet> StylePropertySet::copyBlockProperties() const 1110 1110 { 1111 1111 return copyPropertiesInSet(blockProperties, numBlockProperties); -
trunk/Source/WebCore/css/StylePropertySet.h
r148400 r148402 118 118 void removePrefixedOrUnprefixedProperty(CSSPropertyID); 119 119 120 PassRefPtr< StylePropertySet> copyBlockProperties() const;120 PassRefPtr<MutableStylePropertySet> copyBlockProperties() const; 121 121 void removeBlockProperties(); 122 122 bool removePropertiesInSet(const CSSPropertyID* set, unsigned length); -
trunk/Source/WebCore/editing/EditingStyle.cpp
r148396 r148402 109 109 } 110 110 111 static PassRefPtr< StylePropertySet> getPropertiesNotIn(StylePropertySet* styleWithRedundantProperties, CSSStyleDeclaration* baseStyle);111 static PassRefPtr<MutableStylePropertySet> getPropertiesNotIn(StylePropertySet* styleWithRedundantProperties, CSSStyleDeclaration* baseStyle); 112 112 enum LegacyFontSizeMode { AlwaysUseLegacyFontSize, UseLegacyFontSizeOnlyIfPixelValuesMatch }; 113 113 static int legacyFontSizeFromCSSValue(Document*, CSSPrimitiveValue*, bool shouldUseFixedFontDefaultSize, LegacyFontSizeMode); … … 524 524 } 525 525 526 void EditingStyle::setStyle(PassRefPtr< StylePropertySet> style)526 void EditingStyle::setStyle(PassRefPtr<MutableStylePropertySet> style) 527 527 { 528 528 m_mutableStyle = style; … … 1089 1089 void EditingStyle::mergeStyleFromRules(StyledElement* element) 1090 1090 { 1091 RefPtr< StylePropertySet> styleFromMatchedRules = styleFromMatchedRulesForElement(element,1091 RefPtr<MutableStylePropertySet> styleFromMatchedRules = styleFromMatchedRulesForElement(element, 1092 1092 StyleResolver::AuthorCSSRules | StyleResolver::CrossOriginCSSRules); 1093 1093 // Styles from the inline style declaration, held in the variable "style", take precedence … … 1343 1343 RefPtr<CSSComputedStyleDeclaration> computedStyle = position.computedStyle(); 1344 1344 // FIXME: take care of background-color in effect 1345 RefPtr< StylePropertySet> mutableStyle = getPropertiesNotIn(style->style(), computedStyle.get());1345 RefPtr<MutableStylePropertySet> mutableStyle = getPropertiesNotIn(style->style(), computedStyle.get()); 1346 1346 1347 1347 reconcileTextDecorationProperties(mutableStyle.get()); … … 1362 1362 } 1363 1363 1364 static void setTextDecorationProperty( StylePropertySet* style, const CSSValueList* newTextDecoration, CSSPropertyID propertyID)1364 static void setTextDecorationProperty(MutableStylePropertySet* style, const CSSValueList* newTextDecoration, CSSPropertyID propertyID) 1365 1365 { 1366 1366 if (newTextDecoration->length()) … … 1373 1373 } 1374 1374 1375 void StyleChange::extractTextStyles(Document* document, StylePropertySet* style, bool shouldUseFixedFontDefaultSize)1375 void StyleChange::extractTextStyles(Document* document, MutableStylePropertySet* style, bool shouldUseFixedFontDefaultSize) 1376 1376 { 1377 1377 ASSERT(style); … … 1438 1438 } 1439 1439 1440 static void diffTextDecorations( StylePropertySet* style, CSSPropertyID propertID, CSSValue* refTextDecoration)1440 static void diffTextDecorations(MutableStylePropertySet* style, CSSPropertyID propertID, CSSValue* refTextDecoration) 1441 1441 { 1442 1442 RefPtr<CSSValue> textDecoration = style->getPropertyCSSValue(propertID); … … 1496 1496 } 1497 1497 1498 PassRefPtr< StylePropertySet> getPropertiesNotIn(StylePropertySet* styleWithRedundantProperties, CSSStyleDeclaration* baseStyle)1498 PassRefPtr<MutableStylePropertySet> getPropertiesNotIn(StylePropertySet* styleWithRedundantProperties, CSSStyleDeclaration* baseStyle) 1499 1499 { 1500 1500 ASSERT(styleWithRedundantProperties); … … 1521 1521 result->removeProperty(CSSPropertyBackgroundColor); 1522 1522 1523 return result ;1523 return result.release(); 1524 1524 } 1525 1525 -
trunk/Source/WebCore/editing/EditingStyle.h
r141588 r148402 51 51 class Element; 52 52 class HTMLElement; 53 class MutableStylePropertySet; 53 54 class Node; 54 55 class Position; … … 99 100 ~EditingStyle(); 100 101 101 StylePropertySet* style() { return m_mutableStyle.get(); }102 MutableStylePropertySet* style() { return m_mutableStyle.get(); } 102 103 bool textDirection(WritingDirection&) const; 103 104 bool isEmpty() const; 104 void setStyle(PassRefPtr< StylePropertySet>);105 void setStyle(PassRefPtr<MutableStylePropertySet>); 105 106 void overrideWithStyle(const StylePropertySet*); 106 107 void clear(); … … 164 165 void mergeStyle(const StylePropertySet*, CSSPropertyOverrideMode); 165 166 166 RefPtr< StylePropertySet> m_mutableStyle;167 RefPtr<MutableStylePropertySet> m_mutableStyle; 167 168 bool m_shouldUseFixedDefaultFontSize; 168 169 float m_fontSizeDelta; … … 218 219 } 219 220 private: 220 void extractTextStyles(Document*, StylePropertySet*, bool shouldUseFixedFontDefaultSize);221 void extractTextStyles(Document*, MutableStylePropertySet*, bool shouldUseFixedFontDefaultSize); 221 222 222 223 String m_cssStyle;
Note: See TracChangeset
for help on using the changeset viewer.