diff options
Diffstat (limited to 'Source/WebCore/css/StylePropertyShorthand.h')
-rw-r--r-- | Source/WebCore/css/StylePropertyShorthand.h | 97 |
1 files changed, 18 insertions, 79 deletions
diff --git a/Source/WebCore/css/StylePropertyShorthand.h b/Source/WebCore/css/StylePropertyShorthand.h index 95f1989e7..cef65c12c 100644 --- a/Source/WebCore/css/StylePropertyShorthand.h +++ b/Source/WebCore/css/StylePropertyShorthand.h @@ -19,8 +19,7 @@ * Boston, MA 02110-1301, USA. */ -#ifndef StylePropertyShorthand_h -#define StylePropertyShorthand_h +#pragma once #include "CSSPropertyNames.h" #include <wtf/Vector.h> @@ -29,23 +28,10 @@ namespace WebCore { class StylePropertyShorthand { public: - StylePropertyShorthand() - : m_properties(0) - , m_propertiesForInitialization(0) - , m_length(0) - , m_shorthandID(CSSPropertyInvalid) - { - } - - StylePropertyShorthand(CSSPropertyID id, const CSSPropertyID* properties, unsigned numProperties) - : m_properties(properties) - , m_propertiesForInitialization(0) - , m_length(numProperties) - , m_shorthandID(id) - { - } + StylePropertyShorthand() = default; - StylePropertyShorthand(CSSPropertyID id, const CSSPropertyID* properties, const StylePropertyShorthand* propertiesForInitialization, unsigned numProperties) + template<unsigned numProperties> + StylePropertyShorthand(CSSPropertyID id, const CSSPropertyID (&properties)[numProperties], const StylePropertyShorthand* propertiesForInitialization = nullptr) : m_properties(properties) , m_propertiesForInitialization(propertiesForInitialization) , m_length(numProperties) @@ -59,75 +45,28 @@ public: CSSPropertyID id() const { return m_shorthandID; } private: - const CSSPropertyID* m_properties; - const StylePropertyShorthand* m_propertiesForInitialization; - unsigned m_length; - CSSPropertyID m_shorthandID; + const CSSPropertyID* m_properties { nullptr }; + const StylePropertyShorthand* m_propertiesForInitialization { nullptr }; + unsigned m_length { 0 }; + CSSPropertyID m_shorthandID { CSSPropertyInvalid }; }; -StylePropertyShorthand backgroundShorthand(); -StylePropertyShorthand backgroundPositionShorthand(); -StylePropertyShorthand backgroundRepeatShorthand(); -StylePropertyShorthand borderShorthand(); +// Custom StylePropertyShorthand functions. +StylePropertyShorthand animationShorthandForParsing(); +StylePropertyShorthand transitionShorthandForParsing(); StylePropertyShorthand borderAbridgedShorthand(); -StylePropertyShorthand borderBottomShorthand(); -StylePropertyShorthand borderColorShorthand(); -StylePropertyShorthand borderImageShorthand(); -StylePropertyShorthand borderLeftShorthand(); -StylePropertyShorthand borderRadiusShorthand(); -StylePropertyShorthand borderRightShorthand(); -StylePropertyShorthand borderSpacingShorthand(); -StylePropertyShorthand borderStyleShorthand(); -StylePropertyShorthand borderTopShorthand(); -StylePropertyShorthand borderWidthShorthand(); -StylePropertyShorthand listStyleShorthand(); -StylePropertyShorthand fontShorthand(); -StylePropertyShorthand heightShorthand(); -StylePropertyShorthand marginShorthand(); -StylePropertyShorthand outlineShorthand(); -StylePropertyShorthand overflowShorthand(); -StylePropertyShorthand paddingShorthand(); -StylePropertyShorthand transitionShorthand(); -StylePropertyShorthand webkitAnimationShorthand(); -StylePropertyShorthand webkitAnimationShorthandForParsing(); -StylePropertyShorthand webkitBorderAfterShorthand(); -StylePropertyShorthand webkitBorderBeforeShorthand(); -StylePropertyShorthand webkitBorderEndShorthand(); -StylePropertyShorthand webkitBorderRadiusShorthand(); -StylePropertyShorthand webkitBorderStartShorthand(); -StylePropertyShorthand webkitColumnsShorthand(); -StylePropertyShorthand webkitColumnRuleShorthand(); -StylePropertyShorthand webkitFlexFlowShorthand(); -StylePropertyShorthand webkitFlexShorthand(); -StylePropertyShorthand webkitGridAreaShorthand(); -StylePropertyShorthand webkitGridColumnShorthand(); -StylePropertyShorthand webkitGridRowShorthand(); -StylePropertyShorthand webkitMarginCollapseShorthand(); -StylePropertyShorthand webkitMarqueeShorthand(); -StylePropertyShorthand webkitMaskShorthand(); -StylePropertyShorthand webkitMaskPositionShorthand(); -StylePropertyShorthand webkitMaskRepeatShorthand(); -StylePropertyShorthand webkitTextEmphasisShorthand(); -StylePropertyShorthand webkitTextStrokeShorthand(); -StylePropertyShorthand webkitTransitionShorthand(); -StylePropertyShorthand webkitTransformOriginShorthand(); -StylePropertyShorthand widthShorthand(); - -StylePropertyShorthand webkitTextDecorationShorthand(); - -#if ENABLE(SVG) -StylePropertyShorthand markerShorthand(); -#endif // Returns empty value if the property is not a shorthand. +// The implementation is generated in StylePropertyShorthandFunctions.cpp. StylePropertyShorthand shorthandForProperty(CSSPropertyID); // Return the list of shorthands for a given longhand. -Vector<StylePropertyShorthand> matchingShorthandsForLonghand(CSSPropertyID); -unsigned indexOfShorthandForLonghand(CSSPropertyID, const Vector<StylePropertyShorthand>&); +// The implementation is generated in StylePropertyShorthandFunctions.cpp. +using StylePropertyShorthandVector = Vector<StylePropertyShorthand, 4>; +StylePropertyShorthandVector matchingShorthandsForLonghand(CSSPropertyID); -bool isExpandedShorthand(CSSPropertyID); +unsigned indexOfShorthandForLonghand(CSSPropertyID, const StylePropertyShorthandVector&); -} // namespace WebCore +bool isShorthandCSSProperty(CSSPropertyID); -#endif // StylePropertyShorthand_h +} // namespace WebCore |