Changeset 175464 in webkit
- Timestamp:
- Nov 2, 2014 2:47:30 PM (10 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r175463 r175464 1 2014-11-02 Chris Dumez <cdumez@apple.com> 2 3 Move string-typed properties to the new StyleBuilder 4 https://bugs.webkit.org/show_bug.cgi?id=138295 5 6 Reviewed by Antti Koivisto. 7 8 Move string-typed properties to the new StyleBuilder: 9 -webkit-hyphenate-character 10 -webkit-line-grid 11 -webkit-flow-into 12 -webkit-flow-from 13 14 No new tests, no behavior change. 15 1 16 2014-11-02 Chris Dumez <cdumez@apple.com> 2 17 -
trunk/Source/WebCore/css/CSSPropertyNames.in
r175458 r175464 388 388 -webkit-grid-auto-flow 389 389 #endif 390 -webkit-hyphenate-character [Inherited ]390 -webkit-hyphenate-character [Inherited, NewStyleBuilder, NameForMethods=HyphenationString, Converter=StringOrAuto] 391 391 -webkit-hyphenate-limit-after [Inherited, NewStyleBuilder, NameForMethods=HyphenationLimitAfter, Converter=Number<short>] 392 392 -webkit-hyphenate-limit-before [Inherited, NewStyleBuilder, NameForMethods=HyphenationLimitBefore, Converter=Number<short>] … … 399 399 -webkit-line-break [Inherited, NewStyleBuilder, TypeName=LineBreak] 400 400 -webkit-line-clamp [NewStyleBuilder, TypeName=LineClampValue] 401 -webkit-line-grid [Inherited ]401 -webkit-line-grid [Inherited, NewStyleBuilder, Converter=StringOrNone] 402 402 -webkit-line-snap [Inherited, NewStyleBuilder, TypeName=LineSnap] 403 403 -webkit-logical-width … … 505 505 -webkit-user-select [Inherited, NewStyleBuilder] 506 506 #if defined(ENABLE_CSS_REGIONS) && ENABLE_CSS_REGIONS 507 -webkit-flow-into 508 -webkit-flow-from 507 -webkit-flow-into [NewStyleBuilder, NameForMethods=FlowThread, Converter=StringOrNone] 508 -webkit-flow-from [NewStyleBuilder, NameForMethods=RegionThread, Converter=StringOrNone] 509 509 -webkit-region-fragment [NewStyleBuilder, TypeName=RegionFragment] 510 510 -webkit-region-break-after [NewStyleBuilder, TypeName=EPageBreak, Initial=initialPageBreak] -
trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp
r175458 r175464 301 301 302 302 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); } 303 };304 305 enum StringIdentBehavior { NothingMapsToNull = 0, MapNoneToNull, MapAutoToNull };306 template <StringIdentBehavior identBehavior, const AtomicString& (RenderStyle::*getterFunction)() const, void (RenderStyle::*setterFunction)(const AtomicString&), const AtomicString& (*initialFunction)()>307 class ApplyPropertyString {308 public:309 static void setValue(RenderStyle* style, const AtomicString& value) { (style->*setterFunction)(value); }310 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)311 {312 if (!is<CSSPrimitiveValue>(*value))313 return;314 CSSPrimitiveValue& primitiveValue = downcast<CSSPrimitiveValue>(*value);315 if ((identBehavior == MapNoneToNull && primitiveValue.getValueID() == CSSValueNone)316 || (identBehavior == MapAutoToNull && primitiveValue.getValueID() == CSSValueAuto))317 setValue(styleResolver->style(), nullAtom);318 else319 setValue(styleResolver->style(), primitiveValue.getStringValue());320 }321 static PropertyHandler createHandler()322 {323 PropertyHandler handler = ApplyPropertyDefaultBase<const AtomicString&, getterFunction, const AtomicString&, setterFunction, const AtomicString&, initialFunction>::createHandler();324 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);325 }326 303 }; 327 304 … … 2116 2093 setPropertyHandler(CSSPropertyColumnRuleColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::columnRuleColor, &RenderStyle::setColumnRuleColor, &RenderStyle::setVisitedLinkColumnRuleColor, &RenderStyle::color>::createHandler()); 2117 2094 setPropertyHandler(CSSPropertyColumnWidth, ApplyPropertyAuto<float, &RenderStyle::columnWidth, &RenderStyle::setColumnWidth, &RenderStyle::hasAutoColumnWidth, &RenderStyle::setHasAutoColumnWidth, ComputeLength>::createHandler()); 2118 #if ENABLE(CSS_REGIONS)2119 setPropertyHandler(CSSPropertyWebkitFlowFrom, ApplyPropertyString<MapNoneToNull, &RenderStyle::regionThread, &RenderStyle::setRegionThread, &RenderStyle::initialRegionThread>::createHandler());2120 setPropertyHandler(CSSPropertyWebkitFlowInto, ApplyPropertyString<MapNoneToNull, &RenderStyle::flowThread, &RenderStyle::setFlowThread, &RenderStyle::initialFlowThread>::createHandler());2121 #endif2122 2095 setPropertyHandler(CSSPropertyWebkitFontKerning, ApplyPropertyFont<FontDescription::Kerning, &FontDescription::kerning, &FontDescription::setKerning, FontDescription::AutoKerning>::createHandler()); 2123 2096 setPropertyHandler(CSSPropertyWebkitFontSmoothing, ApplyPropertyFont<FontSmoothingMode, &FontDescription::fontSmoothing, &FontDescription::setFontSmoothing, AutoSmoothing>::createHandler()); 2124 2097 setPropertyHandler(CSSPropertyWebkitFontVariantLigatures, ApplyPropertyFontVariantLigatures::createHandler()); 2125 setPropertyHandler(CSSPropertyWebkitHyphenateCharacter, ApplyPropertyString<MapAutoToNull, &RenderStyle::hyphenationString, &RenderStyle::setHyphenationString, &RenderStyle::initialHyphenationString>::createHandler());2126 setPropertyHandler(CSSPropertyWebkitLineGrid, ApplyPropertyString<MapNoneToNull, &RenderStyle::lineGrid, &RenderStyle::setLineGrid, &RenderStyle::initialLineGrid>::createHandler());2127 2098 setPropertyHandler(CSSPropertyWebkitMarqueeRepetition, ApplyPropertyMarqueeRepetition::createHandler()); 2128 2099 setPropertyHandler(CSSPropertyWebkitMarqueeSpeed, ApplyPropertyMarqueeSpeed::createHandler()); -
trunk/Source/WebCore/css/StyleBuilderConverter.h
r175454 r175464 54 54 template <CSSPropertyID property> static PassRefPtr<StyleImage> convertBorderImageSource(StyleResolver&, CSSValue&); 55 55 static TransformOperations convertTransform(StyleResolver&, CSSValue&); 56 static String convertString(StyleResolver&, CSSValue&); 57 static String convertStringOrAuto(StyleResolver&, CSSValue&); 58 static String convertStringOrNone(StyleResolver&, CSSValue&); 56 59 57 60 private: … … 250 253 } 251 254 255 inline String StyleBuilderConverter::convertString(StyleResolver&, CSSValue& value) 256 { 257 return downcast<CSSPrimitiveValue>(value).getStringValue(); 258 } 259 260 inline String StyleBuilderConverter::convertStringOrAuto(StyleResolver& styleResolver, CSSValue& value) 261 { 262 if (downcast<CSSPrimitiveValue>(value).getValueID() == CSSValueAuto) 263 return nullAtom; 264 return convertString(styleResolver, value); 265 } 266 267 inline String StyleBuilderConverter::convertStringOrNone(StyleResolver& styleResolver, CSSValue& value) 268 { 269 if (downcast<CSSPrimitiveValue>(value).getValueID() == CSSValueNone) 270 return nullAtom; 271 return convertString(styleResolver, value); 272 } 273 252 274 } // namespace WebCore 253 275
Note: See TracChangeset
for help on using the changeset viewer.