Changeset 198284 in webkit
- Timestamp:
- Mar 16, 2016, 9:46:12 AM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/LayoutTests/ChangeLog ¶
r198283 r198284 1 2016-03-16 Antti Koivisto <antti@apple.com> 2 3 Don't invalidate style unnecessarily when setting inline style cssText 4 https://bugs.webkit.org/show_bug.cgi?id=155541 5 rdar://problem/23318893 6 7 Reviewed by Simon Fraser. 8 9 * fast/css/style-invalidation-inline-csstext-expected.txt: Added. 10 * fast/css/style-invalidation-inline-csstext.html: Added. 11 1 12 2016-03-16 Ryan Haddad <ryanhaddad@apple.com> 2 13 -
TabularUnified trunk/Source/WebCore/ChangeLog ¶
r198269 r198284 1 2016-03-16 Antti Koivisto <antti@apple.com> 2 3 Don't invalidate style unnecessarily when setting inline style cssText 4 https://bugs.webkit.org/show_bug.cgi?id=155541 5 rdar://problem/23318893 6 7 Reviewed by Simon Fraser. 8 9 We currently invalidate style when cssText is set whether the style declaration changed or not. 10 11 Based on a patch by Simon. 12 13 Test: fast/css/style-invalidation-inline-csstext.html 14 15 * css/PropertySetCSSStyleDeclaration.cpp: 16 (WebCore::PropertySetCSSStyleDeclaration::cssText): 17 (WebCore::PropertySetCSSStyleDeclaration::setCssText): 18 19 Invalidate only if the parsed style changed. 20 21 * css/StyleProperties.cpp: 22 (WebCore::MutableStyleProperties::parseDeclaration): 23 24 Compare the original and new style after parsing, return result. 25 26 * css/StyleProperties.h: 27 1 28 2016-03-16 Carlos Garcia Campos <cgarcia@igalia.com> 2 29 -
TabularUnified trunk/Source/WebCore/css/PropertySetCSSStyleDeclaration.cpp ¶
r190209 r198284 146 146 return m_propertySet->asText(); 147 147 } 148 149 void PropertySetCSSStyleDeclaration::setCssText(const String& text, ExceptionCode& ec)148 149 void PropertySetCSSStyleDeclaration::setCssText(const String& text, ExceptionCode&) 150 150 { 151 151 StyleAttributeMutationScope mutationScope(this); … … 153 153 return; 154 154 155 ec = 0; 156 // FIXME: Detect syntax errors and set ec. 157 m_propertySet->parseDeclaration(text, contextStyleSheet()); 158 159 didMutate(PropertyChanged); 155 bool changed = m_propertySet->parseDeclaration(text, contextStyleSheet()); 156 157 didMutate(changed ? PropertyChanged : NoChanges); 160 158 161 159 mutationScope.enqueueMutationRecord(); -
TabularUnified trunk/Source/WebCore/css/StyleProperties.cpp ¶
r195304 r198284 844 844 } 845 845 846 void MutableStyleProperties::parseDeclaration(const String& styleDeclaration, StyleSheetContents* contextStyleSheet) 847 { 846 bool MutableStyleProperties::parseDeclaration(const String& styleDeclaration, StyleSheetContents* contextStyleSheet) 847 { 848 auto oldProperties = WTFMove(m_propertyVector); 848 849 m_propertyVector.clear(); 849 850 … … 855 856 CSSParser parser(context); 856 857 parser.parseDeclaration(this, styleDeclaration, 0, contextStyleSheet); 858 859 // We could do better. Just changing property order does not require style invalidation. 860 return oldProperties != m_propertyVector; 857 861 } 858 862 -
TabularUnified trunk/Source/WebCore/css/StyleProperties.h ¶
r195304 r198284 224 224 225 225 void clear(); 226 voidparseDeclaration(const String& styleDeclaration, StyleSheetContents* contextStyleSheet);226 bool parseDeclaration(const String& styleDeclaration, StyleSheetContents* contextStyleSheet); 227 227 228 228 WEBCORE_EXPORT CSSStyleDeclaration* ensureCSSStyleDeclaration();
Note:
See TracChangeset
for help on using the changeset viewer.