[CSS Grid Layout] Implementation of the grid-template shorthand.
[WebKit-https.git] / Source / WebCore / css / StylePropertyShorthand.h
1 /*
2  * (C) 1999-2003 Lars Knoll (knoll@kde.org)
3  * Copyright (C) 2004, 2005, 2006, 2008, 2013 Apple Inc. All rights reserved.
4  * Copyright (C) 2013 Intel Corporation. All rights reserved.
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public License
17  * along with this library; see the file COPYING.LIB.  If not, write to
18  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  * Boston, MA 02110-1301, USA.
20  */
21
22 #ifndef StylePropertyShorthand_h
23 #define StylePropertyShorthand_h
24
25 #include "CSSPropertyNames.h"
26 #include <wtf/Vector.h>
27
28 namespace WebCore {
29
30 class StylePropertyShorthand {
31 public:
32     StylePropertyShorthand()
33         : m_properties(0)
34         , m_propertiesForInitialization(0)
35         , m_length(0)
36         , m_shorthandID(CSSPropertyInvalid)
37     {
38     }
39
40     StylePropertyShorthand(CSSPropertyID id, const CSSPropertyID* properties, unsigned numProperties)
41         : m_properties(properties)
42         , m_propertiesForInitialization(0)
43         , m_length(numProperties)
44         , m_shorthandID(id)
45     {
46     }
47
48     StylePropertyShorthand(CSSPropertyID id, const CSSPropertyID* properties, const StylePropertyShorthand* propertiesForInitialization, unsigned numProperties)
49         : m_properties(properties)
50         , m_propertiesForInitialization(propertiesForInitialization)
51         , m_length(numProperties)
52         , m_shorthandID(id)
53     {
54     }
55
56     const CSSPropertyID* properties() const { return m_properties; }
57     const StylePropertyShorthand* propertiesForInitialization() const { return m_propertiesForInitialization; }
58     unsigned length() const { return m_length; }
59     CSSPropertyID id() const { return m_shorthandID; }
60
61 private:
62     const CSSPropertyID* m_properties;
63     const StylePropertyShorthand* m_propertiesForInitialization;
64     unsigned m_length;
65     CSSPropertyID m_shorthandID;
66 };
67
68 StylePropertyShorthand backgroundShorthand();
69 StylePropertyShorthand backgroundPositionShorthand();
70 StylePropertyShorthand backgroundRepeatShorthand();
71 StylePropertyShorthand borderShorthand();
72 StylePropertyShorthand borderAbridgedShorthand();
73 StylePropertyShorthand borderBottomShorthand();
74 StylePropertyShorthand borderColorShorthand();
75 StylePropertyShorthand borderImageShorthand();
76 StylePropertyShorthand borderLeftShorthand();
77 StylePropertyShorthand borderRadiusShorthand();
78 StylePropertyShorthand borderRightShorthand();
79 StylePropertyShorthand borderSpacingShorthand();
80 StylePropertyShorthand borderStyleShorthand();
81 StylePropertyShorthand borderTopShorthand();
82 StylePropertyShorthand borderWidthShorthand();
83 StylePropertyShorthand listStyleShorthand();
84 StylePropertyShorthand fontShorthand();
85 StylePropertyShorthand heightShorthand();
86 StylePropertyShorthand marginShorthand();
87 StylePropertyShorthand outlineShorthand();
88 StylePropertyShorthand overflowShorthand();
89 StylePropertyShorthand paddingShorthand();
90 StylePropertyShorthand transitionShorthand();
91 StylePropertyShorthand webkitAnimationShorthand();
92 StylePropertyShorthand webkitAnimationShorthandForParsing();
93 StylePropertyShorthand webkitBorderAfterShorthand();
94 StylePropertyShorthand webkitBorderBeforeShorthand();
95 StylePropertyShorthand webkitBorderEndShorthand();
96 StylePropertyShorthand webkitBorderRadiusShorthand();
97 StylePropertyShorthand webkitBorderStartShorthand();
98 StylePropertyShorthand webkitColumnsShorthand();
99 StylePropertyShorthand webkitColumnRuleShorthand();
100 StylePropertyShorthand webkitFlexFlowShorthand();
101 StylePropertyShorthand webkitFlexShorthand();
102 StylePropertyShorthand webkitGridTemplateShorthand();
103 StylePropertyShorthand webkitGridAreaShorthand();
104 StylePropertyShorthand webkitGridColumnShorthand();
105 StylePropertyShorthand webkitGridRowShorthand();
106 StylePropertyShorthand webkitMarginCollapseShorthand();
107 StylePropertyShorthand webkitMarqueeShorthand();
108 StylePropertyShorthand webkitMaskShorthand();
109 StylePropertyShorthand webkitMaskPositionShorthand();
110 StylePropertyShorthand webkitMaskRepeatShorthand();
111 StylePropertyShorthand webkitTextEmphasisShorthand();
112 StylePropertyShorthand webkitTextStrokeShorthand();
113 StylePropertyShorthand webkitTransitionShorthand();
114 StylePropertyShorthand webkitTransformOriginShorthand();
115 StylePropertyShorthand widthShorthand();
116
117 StylePropertyShorthand webkitTextDecorationShorthand();
118
119 StylePropertyShorthand markerShorthand();
120
121 // Returns empty value if the property is not a shorthand.
122 StylePropertyShorthand shorthandForProperty(CSSPropertyID);
123
124 // Return the list of shorthands for a given longhand.
125 Vector<StylePropertyShorthand> matchingShorthandsForLonghand(CSSPropertyID);
126 unsigned indexOfShorthandForLonghand(CSSPropertyID, const Vector<StylePropertyShorthand>&);
127
128 bool isExpandedShorthand(CSSPropertyID);
129
130 } // namespace WebCore
131
132 #endif // StylePropertyShorthand_h