OLD | NEW |
| (Empty) |
1 /* | |
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) | |
3 * (C) 2000 Antti Koivisto (koivisto@kde.org) | |
4 * (C) 2000 Dirk Mueller (mueller@kde.org) | |
5 * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | |
6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) | |
7 * | |
8 * This library is free software; you can redistribute it and/or | |
9 * modify it under the terms of the GNU Library General Public | |
10 * License as published by the Free Software Foundation; either | |
11 * version 2 of the License, or (at your option) any later version. | |
12 * | |
13 * This library is distributed in the hope that it will be useful, | |
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
16 * Library General Public License for more details. | |
17 * | |
18 * You should have received a copy of the GNU Library General Public License | |
19 * along with this library; see the file COPYING.LIB. If not, write to | |
20 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | |
21 * Boston, MA 02110-1301, USA. | |
22 * | |
23 */ | |
24 | |
25 #ifndef StyleRareNonInheritedData_h | |
26 #define StyleRareNonInheritedData_h | |
27 | |
28 #include "core/css/StyleColor.h" | |
29 #include "core/layout/ClipPathOperation.h" | |
30 #include "core/layout/style/BasicShapes.h" | |
31 #include "core/layout/style/CounterDirectives.h" | |
32 #include "core/layout/style/CursorData.h" | |
33 #include "core/layout/style/DataRef.h" | |
34 #include "core/layout/style/FillLayer.h" | |
35 #include "core/layout/style/ComputedStyleConstants.h" | |
36 #include "core/layout/style/LineClampValue.h" | |
37 #include "core/layout/style/NinePieceImage.h" | |
38 #include "core/layout/style/ShapeValue.h" | |
39 #include "platform/LengthPoint.h" | |
40 #include "wtf/OwnPtr.h" | |
41 #include "wtf/PassRefPtr.h" | |
42 #include "wtf/Vector.h" | |
43 | |
44 namespace blink { | |
45 | |
46 class ContentData; | |
47 class CSSAnimationData; | |
48 class CSSTransitionData; | |
49 class LengthSize; | |
50 class ShadowList; | |
51 class StyleDeprecatedFlexibleBoxData; | |
52 class StyleFilterData; | |
53 class StyleFlexibleBoxData; | |
54 class StyleGridData; | |
55 class StyleGridItemData; | |
56 class StyleMultiColData; | |
57 class StyleReflection; | |
58 class StyleTransformData; | |
59 class StyleWillChangeData; | |
60 | |
61 // Page size type. | |
62 // StyleRareNonInheritedData::m_pageSize is meaningful only when | |
63 // StyleRareNonInheritedData::m_pageSizeType is PAGE_SIZE_RESOLVED. | |
64 enum PageSizeType { | |
65 PAGE_SIZE_AUTO, // size: auto | |
66 PAGE_SIZE_AUTO_LANDSCAPE, // size: landscape | |
67 PAGE_SIZE_AUTO_PORTRAIT, // size: portrait | |
68 PAGE_SIZE_RESOLVED // Size is fully resolved. | |
69 }; | |
70 | |
71 // This struct is for rarely used non-inherited CSS3, CSS2, and WebKit-specific
properties. | |
72 // By grouping them together, we save space, and only allocate this object when
someone | |
73 // actually uses one of these properties. | |
74 class StyleRareNonInheritedData : public RefCounted<StyleRareNonInheritedData> { | |
75 public: | |
76 static PassRefPtr<StyleRareNonInheritedData> create() { return adoptRef(new
StyleRareNonInheritedData); } | |
77 PassRefPtr<StyleRareNonInheritedData> copy() const { return adoptRef(new Sty
leRareNonInheritedData(*this)); } | |
78 ~StyleRareNonInheritedData(); | |
79 | |
80 bool operator==(const StyleRareNonInheritedData&) const; | |
81 bool operator!=(const StyleRareNonInheritedData& o) const { return !(*this =
= o); } | |
82 | |
83 bool contentDataEquivalent(const StyleRareNonInheritedData&) const; | |
84 bool counterDataEquivalent(const StyleRareNonInheritedData&) const; | |
85 bool shadowDataEquivalent(const StyleRareNonInheritedData&) const; | |
86 bool reflectionDataEquivalent(const StyleRareNonInheritedData&) const; | |
87 bool animationDataEquivalent(const StyleRareNonInheritedData&) const; | |
88 bool transitionDataEquivalent(const StyleRareNonInheritedData&) const; | |
89 bool shapeOutsideDataEquivalent(const StyleRareNonInheritedData&) const; | |
90 bool clipPathDataEquivalent(const StyleRareNonInheritedData&) const; | |
91 bool hasFilters() const; | |
92 bool hasOpacity() const { return opacity < 1; } | |
93 | |
94 float opacity; // Whether or not we're transparent. | |
95 | |
96 float m_perspective; | |
97 LengthPoint m_perspectiveOrigin; | |
98 | |
99 LineClampValue lineClamp; // An Apple extension. | |
100 DraggableRegionMode m_draggableRegionMode; | |
101 | |
102 DataRef<StyleDeprecatedFlexibleBoxData> m_deprecatedFlexibleBox; // Flexible
box properties | |
103 DataRef<StyleFlexibleBoxData> m_flexibleBox; | |
104 DataRef<StyleMultiColData> m_multiCol; // CSS3 multicol properties | |
105 DataRef<StyleTransformData> m_transform; // Transform properties (rotate, sc
ale, skew, etc.) | |
106 DataRef<StyleWillChangeData> m_willChange; // CSS Will Change | |
107 | |
108 DataRef<StyleFilterData> m_filter; // Filter operations (url, sepia, blur, e
tc.) | |
109 | |
110 DataRef<StyleGridData> m_grid; | |
111 DataRef<StyleGridItemData> m_gridItem; | |
112 | |
113 OwnPtr<ContentData> m_content; | |
114 OwnPtr<CounterDirectiveMap> m_counterDirectives; | |
115 | |
116 RefPtr<ShadowList> m_boxShadow; | |
117 | |
118 RefPtr<StyleReflection> m_boxReflect; | |
119 | |
120 OwnPtr<CSSAnimationData> m_animations; | |
121 OwnPtr<CSSTransitionData> m_transitions; | |
122 | |
123 FillLayer m_mask; | |
124 NinePieceImage m_maskBoxImage; | |
125 | |
126 LengthSize m_pageSize; | |
127 | |
128 RefPtr<ShapeValue> m_shapeOutside; | |
129 Length m_shapeMargin; | |
130 float m_shapeImageThreshold; | |
131 | |
132 RefPtr<ClipPathOperation> m_clipPath; | |
133 | |
134 StyleColor m_textDecorationColor; | |
135 StyleColor m_visitedLinkTextDecorationColor; | |
136 StyleColor m_visitedLinkBackgroundColor; | |
137 StyleColor m_visitedLinkOutlineColor; | |
138 StyleColor m_visitedLinkBorderLeftColor; | |
139 StyleColor m_visitedLinkBorderRightColor; | |
140 StyleColor m_visitedLinkBorderTopColor; | |
141 StyleColor m_visitedLinkBorderBottomColor; | |
142 | |
143 int m_order; | |
144 | |
145 LengthPoint m_objectPosition; | |
146 | |
147 Vector<String> m_callbackSelectors; | |
148 | |
149 unsigned m_pageSizeType : 2; // PageSizeType | |
150 unsigned m_transformStyle3D : 1; // ETransformStyle3D | |
151 unsigned m_backfaceVisibility : 1; // EBackfaceVisibility | |
152 | |
153 unsigned m_alignContent : 4; // ContentPosition | |
154 unsigned m_alignContentDistribution : 3; // ContentDistributionType | |
155 unsigned m_alignContentOverflowAlignment : 2; // OverflowAlignment | |
156 unsigned m_alignItems : 4; // ItemPosition | |
157 unsigned m_alignItemsOverflowAlignment : 2; // OverflowAlignment | |
158 unsigned m_alignSelf : 4; // ItemPosition | |
159 unsigned m_alignSelfOverflowAlignment : 2; // OverflowAlignment | |
160 unsigned m_justifyContent : 4; // ContentPosition | |
161 unsigned m_justifyContentDistribution : 3; // ContentDistributionType | |
162 unsigned m_justifyContentOverflowAlignment : 2; // OverflowAlignment | |
163 | |
164 unsigned userDrag : 2; // EUserDrag | |
165 unsigned textOverflow : 1; // Whether or not lines that spill out should be
truncated with "..." | |
166 unsigned marginBeforeCollapse : 2; // EMarginCollapse | |
167 unsigned marginAfterCollapse : 2; // EMarginCollapse | |
168 unsigned m_appearance : 6; // EAppearance | |
169 unsigned m_textCombine : 1; // CSS3 text-combine properties | |
170 | |
171 unsigned m_textDecorationStyle : 3; // TextDecorationStyle | |
172 unsigned m_wrapFlow: 3; // WrapFlow | |
173 unsigned m_wrapThrough: 1; // WrapThrough | |
174 | |
175 unsigned m_hasCurrentOpacityAnimation : 1; | |
176 unsigned m_hasCurrentTransformAnimation : 1; | |
177 unsigned m_hasCurrentFilterAnimation : 1; | |
178 unsigned m_runningOpacityAnimationOnCompositor : 1; | |
179 unsigned m_runningTransformAnimationOnCompositor : 1; | |
180 unsigned m_runningFilterAnimationOnCompositor : 1; | |
181 | |
182 unsigned m_effectiveBlendMode: 5; // EBlendMode | |
183 | |
184 unsigned m_touchAction : TouchActionBits; // TouchAction | |
185 | |
186 unsigned m_objectFit : 3; // ObjectFit | |
187 | |
188 unsigned m_isolation : 1; // Isolation | |
189 | |
190 unsigned m_justifyItems : 4; // ItemPosition | |
191 unsigned m_justifyItemsOverflowAlignment : 2; // OverflowAlignment | |
192 unsigned m_justifyItemsPositionType: 1; // Whether or not alignment uses the
'legacy' keyword. | |
193 | |
194 unsigned m_justifySelf : 4; // ItemPosition | |
195 unsigned m_justifySelfOverflowAlignment : 2; // OverflowAlignment | |
196 | |
197 // ScrollBehavior. 'scroll-behavior' has 2 accepted values, but ScrollBehavi
or has a third | |
198 // value (that can only be specified using CSSOM scroll APIs) so 2 bits are
needed. | |
199 unsigned m_scrollBehavior: 2; | |
200 | |
201 unsigned m_scrollBlocksOn: 3; // WebScrollBlocksOn | |
202 | |
203 // Plugins require accelerated compositing for reasons external to blink. | |
204 // In which case, we need to update the ComputedStyle on the LayoutEmbeddedO
bject, | |
205 // so store this bit so that the style actually changes when the plugin | |
206 // becomes composited. | |
207 unsigned m_requiresAcceleratedCompositingForExternalReasons: 1; | |
208 | |
209 // Whether the transform (if it exists) is stored in the element's inline st
yle. | |
210 unsigned m_hasInlineTransform : 1; | |
211 unsigned m_resize : 2; // EResize | |
212 | |
213 private: | |
214 StyleRareNonInheritedData(); | |
215 StyleRareNonInheritedData(const StyleRareNonInheritedData&); | |
216 }; | |
217 | |
218 } // namespace blink | |
219 | |
220 #endif // StyleRareNonInheritedData_h | |
OLD | NEW |