Changeset 175458 in webkit
- Timestamp:
- Nov 1, 2014 10:58:02 PM (9 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r175454 r175458 1 2014-11-01 Chris Dumez <cdumez@apple.com> 2 3 Move "direction" CSS property to the new StyleBuilder 4 https://bugs.webkit.org/show_bug.cgi?id=138288 5 6 Reviewed by Sam Weinig. 7 8 Move "direction" CSS property to the new StyleBuilder by using custom 9 code as it requires special handling to call 10 Document::setDirectionSetOnDocumentElement() when necessary. 11 12 No new tests, no behavior change. 13 14 * css/CSSPropertyNames.in: 15 * css/DeprecatedStyleBuilder.cpp: 16 (WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder): 17 (WebCore::ApplyPropertyDirection::applyValue): Deleted. 18 (WebCore::ApplyPropertyDirection::createHandler): Deleted. 19 * css/StyleBuilderCustom.h: 20 (WebCore::StyleBuilderFunctions::applyValueDirection): 21 1 22 2014-11-01 Sam Weinig <sam@webkit.org> 2 23 -
trunk/Source/WebCore/css/CSSPropertyNames.in
r175454 r175458 55 55 // for applying them first. 56 56 color [Inherited] 57 direction [Inherited ]57 direction [Inherited, NewStyleBuilder, Custom=Value] 58 58 display 59 59 font [Inherited] -
trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp
r175439 r175458 301 301 302 302 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); } 303 };304 305 template <TextDirection (RenderStyle::*getterFunction)() const, void (RenderStyle::*setterFunction)(TextDirection), TextDirection (*initialFunction)()>306 class ApplyPropertyDirection {307 public:308 static void applyValue(CSSPropertyID propertyID, StyleResolver* styleResolver, CSSValue* value)309 {310 ApplyPropertyDefault<TextDirection, getterFunction, TextDirection, setterFunction, TextDirection, initialFunction>::applyValue(propertyID, styleResolver, value);311 Element* element = styleResolver->element();312 if (element && styleResolver->element() == element->document().documentElement())313 element->document().setDirectionSetOnDocumentElement(true);314 }315 316 static PropertyHandler createHandler()317 {318 PropertyHandler handler = ApplyPropertyDefault<TextDirection, getterFunction, TextDirection, setterFunction, TextDirection, initialFunction>::createHandler();319 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);320 }321 303 }; 322 304 … … 2090 2072 setPropertyHandler(CSSPropertyCounterReset, ApplyPropertyCounter<Reset>::createHandler()); 2091 2073 setPropertyHandler(CSSPropertyCursor, ApplyPropertyCursor::createHandler()); 2092 setPropertyHandler(CSSPropertyDirection, ApplyPropertyDirection<&RenderStyle::direction, &RenderStyle::setDirection, RenderStyle::initialDirection>::createHandler());2093 2074 setPropertyHandler(CSSPropertyDisplay, ApplyPropertyDisplay::createHandler()); 2094 2075 setPropertyHandler(CSSPropertyFontFamily, ApplyPropertyFontFamily::createHandler()); -
trunk/Source/WebCore/css/StyleBuilderCustom.h
r175445 r175458 58 58 } 59 59 60 inline void applyValueDirection(StyleResolver& styleResolver, CSSValue& value) 61 { 62 styleResolver.style()->setDirection(downcast<CSSPrimitiveValue>(value)); 63 64 Element* element = styleResolver.element(); 65 if (element && styleResolver.element() == element->document().documentElement()) 66 element->document().setDirectionSetOnDocumentElement(true); 67 } 68 60 69 } // namespace StyleBuilderFunctions 61 70
Note: See TracChangeset
for help on using the changeset viewer.