⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 175381 in webkit


Ignore:
Timestamp:
Oct 30, 2014, 2:30:19 PM (12 years ago)
Author:
Chris Dumez
Message:

Move -webkit-border-image / -webkit-mask-box-image to the new StyleBuilder
https://bugs.webkit.org/show_bug.cgi?id=138207

Reviewed by Andreas Kling.

Move -webkit-border-image / -webkit-mask-box-image CSS properties to
the new StyleBuilder so that they are now generated from
CSSPropertyNames.in.

No new tests, no behavior change.

  • css/CSSPropertyNames.in:
  • css/DeprecatedStyleBuilder.cpp:

(WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
(WebCore::ApplyPropertyBorderImage::applyValue): Deleted.
(WebCore::ApplyPropertyBorderImage::createHandler): Deleted.

  • css/StyleBuilderConverter.h:

(WebCore::StyleBuilderConverter::convertBorderImage):
(WebCore::StyleBuilderConverter::convertBorderMask):

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r175380 r175381  
     12014-10-30  Chris Dumez  <cdumez@apple.com>
     2
     3        Move -webkit-border-image / -webkit-mask-box-image to the new StyleBuilder
     4        https://bugs.webkit.org/show_bug.cgi?id=138207
     5
     6        Reviewed by Andreas Kling.
     7
     8        Move -webkit-border-image / -webkit-mask-box-image CSS properties to
     9        the new StyleBuilder so that they are now generated from
     10        CSSPropertyNames.in.
     11
     12        No new tests, no behavior change.
     13
     14        * css/CSSPropertyNames.in:
     15        * css/DeprecatedStyleBuilder.cpp:
     16        (WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
     17        (WebCore::ApplyPropertyBorderImage::applyValue): Deleted.
     18        (WebCore::ApplyPropertyBorderImage::createHandler): Deleted.
     19        * css/StyleBuilderConverter.h:
     20        (WebCore::StyleBuilderConverter::convertBorderImage):
     21        (WebCore::StyleBuilderConverter::convertBorderMask):
     22
    1232014-10-30  Chris Dumez  <cdumez@apple.com>
    224
  • trunk/Source/WebCore/css/CSSPropertyNames.in

    r175267 r175381  
    289289-webkit-border-fit [NewStyleBuilder]
    290290-webkit-border-horizontal-spacing [Inherited, NewStyleBuilder, NameForMethods=HorizontalBorderSpacing, Converter=ComputedLength<short>]
    291 -webkit-border-image
     291-webkit-border-image [NewStyleBuilder, Initial=initialNinePieceImage, Converter=BorderImage<CSSPropertyWebkitBorderImage>]
    292292// -webkit-border-radius differs from border-radius only in the interpretation of
    293293// a value consisting of two lengths: "-webkit-border-radius: l1 l2;" is equivalent
     
    408408-webkit-marquee-style [NewStyleBuilder, TypeName=EMarqueeBehavior, NameForMethods=MarqueeBehavior]
    409409-webkit-mask
    410 -webkit-mask-box-image
     410-webkit-mask-box-image [NewStyleBuilder, Initial=initialNinePieceImage, Converter=BorderMask<CSSPropertyWebkitMaskBoxImage>]
    411411-webkit-mask-box-image-outset
    412412-webkit-mask-box-image-repeat
  • trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp

    r175267 r175381  
    903903
    904904enum BorderImageType { BorderImage = 0, BorderMask };
    905 template <BorderImageType borderImageType,
    906           CSSPropertyID property,
    907           const NinePieceImage& (RenderStyle::*getterFunction)() const,
    908           void (RenderStyle::*setterFunction)(const NinePieceImage&)>
    909 class ApplyPropertyBorderImage {
    910 public:
    911     static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
    912     {
    913         NinePieceImage image;
    914         if (borderImageType == BorderMask)
    915             image.setMaskDefaults();
    916         styleResolver->styleMap()->mapNinePieceImage(property, value, image);
    917         (styleResolver->style()->*setterFunction)(image);
    918     }
    919 
    920     static PropertyHandler createHandler()
    921     {
    922         PropertyHandler handler = ApplyPropertyDefaultBase<const NinePieceImage&, getterFunction, const NinePieceImage&, setterFunction, NinePieceImage, &RenderStyle::initialNinePieceImage>::createHandler();
    923         return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
    924     }
    925 };
    926 
    927905enum BorderImageModifierType { Outset, Repeat, Slice, Width };
    928906template <BorderImageType type, BorderImageModifierType modifier>
     
    22672245    setPropertyHandler(CSSPropertyWebkitBackgroundOrigin, CSSPropertyBackgroundOrigin);
    22682246    setPropertyHandler(CSSPropertyWebkitBackgroundSize, CSSPropertyBackgroundSize);
    2269     setPropertyHandler(CSSPropertyWebkitBorderImage, ApplyPropertyBorderImage<BorderImage, CSSPropertyWebkitBorderImage, &RenderStyle::borderImage, &RenderStyle::setBorderImage>::createHandler());
    22702247    setPropertyHandler(CSSPropertyWebkitColumnCount, ApplyPropertyAuto<unsigned short, &RenderStyle::columnCount, &RenderStyle::setColumnCount, &RenderStyle::hasAutoColumnCount, &RenderStyle::setHasAutoColumnCount>::createHandler());
    22712248    setPropertyHandler(CSSPropertyWebkitColumnGap, ApplyPropertyAuto<float, &RenderStyle::columnGap, &RenderStyle::setColumnGap, &RenderStyle::hasNormalColumnGap, &RenderStyle::setHasNormalColumnGap, ComputeLength, CSSValueNormal>::createHandler());
     
    22842261    setPropertyHandler(CSSPropertyWebkitMarqueeRepetition, ApplyPropertyMarqueeRepetition::createHandler());
    22852262    setPropertyHandler(CSSPropertyWebkitMarqueeSpeed, ApplyPropertyMarqueeSpeed::createHandler());
    2286     setPropertyHandler(CSSPropertyWebkitMaskBoxImage, ApplyPropertyBorderImage<BorderMask, CSSPropertyWebkitMaskBoxImage, &RenderStyle::maskBoxImage, &RenderStyle::setMaskBoxImage>::createHandler());
    22872263    setPropertyHandler(CSSPropertyWebkitMaskBoxImageOutset, ApplyPropertyBorderImageModifier<BorderMask, Outset>::createHandler());
    22882264    setPropertyHandler(CSSPropertyWebkitMaskBoxImageRepeat, ApplyPropertyBorderImageModifier<BorderMask, Repeat>::createHandler());
  • trunk/Source/WebCore/css/StyleBuilderConverter.h

    r175267 r175381  
    4848    static TextDecoration convertTextDecoration(StyleResolver&, CSSValue&);
    4949    template <typename T> static T convertNumber(StyleResolver&, CSSValue&);
     50    template <CSSPropertyID property> static NinePieceImage convertBorderImage(StyleResolver&, CSSValue&);
     51    template <CSSPropertyID property> static NinePieceImage convertBorderMask(StyleResolver&, CSSValue&);
    5052
    5153private:
     
    207209}
    208210
     211template <CSSPropertyID property>
     212inline NinePieceImage StyleBuilderConverter::convertBorderImage(StyleResolver& styleResolver, CSSValue& value)
     213{
     214    NinePieceImage image;
     215    styleResolver.styleMap()->mapNinePieceImage(property, &value, image);
     216    return image;
     217}
     218
     219template <CSSPropertyID property>
     220inline NinePieceImage StyleBuilderConverter::convertBorderMask(StyleResolver& styleResolver, CSSValue& value)
     221{
     222    NinePieceImage image = convertBorderImage<property>(styleResolver, value);
     223    image.setMaskDefaults();
     224    return image;
     225}
     226
    209227} // namespace WebCore
    210228
Note: See TracChangeset for help on using the changeset viewer.