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 <memory> | |
29 #include "core/CoreExport.h" | |
30 #include "core/css/StyleColor.h" | |
31 #include "core/style/ClipPathOperation.h" | |
32 #include "core/style/ComputedStyleConstants.h" | |
33 #include "core/style/CounterDirectives.h" | |
34 #include "core/style/DataPersistent.h" | |
35 #include "core/style/DataRef.h" | |
36 #include "core/style/FillLayer.h" | |
37 #include "core/style/LineClampValue.h" | |
38 #include "core/style/NinePieceImage.h" | |
39 #include "core/style/OutlineValue.h" | |
40 #include "core/style/PaintImages.h" | |
41 #include "core/style/ShapeValue.h" | |
42 #include "core/style/StyleContentAlignmentData.h" | |
43 #include "core/style/StyleScrollSnapData.h" | |
44 #include "core/style/StyleSelfAlignmentData.h" | |
45 #include "platform/LengthPoint.h" | |
46 #include "platform/graphics/TouchAction.h" | |
47 #include "platform/wtf/PassRefPtr.h" | |
48 #include "platform/wtf/RefCounted.h" | |
49 #include "platform/wtf/Vector.h" | |
50 | |
51 namespace blink { | |
52 | |
53 class ContentData; | |
54 class CSSAnimationData; | |
55 class CSSTransitionData; | |
56 class ShadowList; | |
57 class StyleDeprecatedFlexibleBoxData; | |
58 class StyleFilterData; | |
59 class StyleFlexibleBoxData; | |
60 class StyleGridData; | |
61 class StyleGridItemData; | |
62 class StyleMultiColData; | |
63 class StyleNonInheritedVariables; | |
64 class StyleReflection; | |
65 class StyleTransformData; | |
66 class StyleWillChangeData; | |
67 | |
68 // This struct is for rarely used non-inherited CSS3, CSS2, and WebKit-specific | |
69 // properties. By grouping them together, we save space, and only allocate this | |
70 // object when someone actually uses one of these properties. | |
71 // TODO(sashab): Move this into a private class on ComputedStyle, and remove | |
72 // all methods on it, merging them into copy/creation methods on ComputedStyle | |
73 // instead. Keep the allocation logic, only allocating a new object if needed. | |
74 class CORE_EXPORT StyleRareNonInheritedData | |
75 : public RefCounted<StyleRareNonInheritedData> { | |
76 public: | |
77 static PassRefPtr<StyleRareNonInheritedData> Create() { | |
78 return AdoptRef(new StyleRareNonInheritedData); | |
79 } | |
80 PassRefPtr<StyleRareNonInheritedData> Copy() const { | |
81 return AdoptRef(new StyleRareNonInheritedData(*this)); | |
82 } | |
83 ~StyleRareNonInheritedData(); | |
84 | |
85 bool operator==(const StyleRareNonInheritedData&) const; | |
86 bool operator!=(const StyleRareNonInheritedData& o) const { | |
87 return !(*this == o); | |
88 } | |
89 | |
90 float opacity_; // Whether or not we're transparent. | |
91 | |
92 float perspective_; | |
93 float shape_image_threshold_; | |
94 | |
95 int order_; | |
96 | |
97 LengthPoint perspective_origin_; | |
98 LengthPoint object_position_; | |
99 | |
100 LineClampValue line_clamp_; // An Apple extension. | |
101 unsigned draggable_region_mode_ : 2; // DraggableRegionMode | |
102 | |
103 DataRef<StyleDeprecatedFlexibleBoxData> | |
104 deprecated_flexible_box_data_; // Flexible box properties | |
105 DataRef<StyleFlexibleBoxData> flexible_box_data_; | |
106 DataRef<StyleMultiColData> multi_col_data_; // CSS3 multicol properties | |
107 DataRef<StyleTransformData> | |
108 transform_data_; // Transform properties (rotate, scale, skew, etc.) | |
109 DataRef<StyleWillChangeData> will_change_data_; // CSS Will Change | |
110 | |
111 DataPersistent<StyleFilterData> | |
112 filter_; // Filter operations (url, sepia, blur, etc.) | |
113 DataPersistent<StyleFilterData> | |
114 backdrop_filter_; // Backdrop filter operations (url, sepia, blur, etc.) | |
115 | |
116 DataRef<StyleGridData> grid_data_; | |
117 DataRef<StyleGridItemData> grid_item_data_; | |
118 DataRef<StyleScrollSnapData> scroll_snap_data_; | |
119 | |
120 Persistent<ContentData> content_; | |
121 std::unique_ptr<CounterDirectiveMap> counter_directives_; | |
122 std::unique_ptr<CSSAnimationData> animations_; | |
123 std::unique_ptr<CSSTransitionData> transitions_; | |
124 | |
125 RefPtr<ShadowList> box_shadow_; | |
126 | |
127 RefPtr<StyleReflection> box_reflect_; | |
128 | |
129 Persistent<ShapeValue> shape_outside_; | |
130 RefPtr<ClipPathOperation> clip_path_; | |
131 | |
132 FillLayer mask_; | |
133 NinePieceImage mask_box_image_; | |
134 | |
135 FloatSize page_size_; | |
136 Length shape_margin_; | |
137 | |
138 OutlineValue outline_; | |
139 | |
140 StyleColor text_decoration_color_; | |
141 StyleColor visited_link_text_decoration_color_; | |
142 StyleColor visited_link_background_color_; | |
143 StyleColor visited_link_outline_color_; | |
144 StyleColor visited_link_border_left_color_; | |
145 StyleColor visited_link_border_right_color_; | |
146 StyleColor visited_link_border_top_color_; | |
147 StyleColor visited_link_border_bottom_color_; | |
148 | |
149 Vector<String> callback_selectors_; | |
150 | |
151 std::unique_ptr<PaintImages> paint_images_; | |
152 | |
153 std::unique_ptr<StyleNonInheritedVariables> non_inherited_variables_; | |
154 | |
155 StyleContentAlignmentData align_content_; | |
156 StyleSelfAlignmentData align_items_; | |
157 StyleSelfAlignmentData align_self_; | |
158 StyleContentAlignmentData justify_content_; | |
159 StyleSelfAlignmentData justify_items_; | |
160 StyleSelfAlignmentData justify_self_; | |
161 | |
162 unsigned page_size_type_ : 2; // PageSizeType | |
163 unsigned transform_style_3d_ : 1; // ETransformStyle3D | |
164 unsigned backface_visibility_ : 1; // EBackfaceVisibility | |
165 | |
166 unsigned user_drag_ : 2; // EUserDrag | |
167 unsigned text_overflow_ : 1; // Whether or not lines that spill out should be | |
168 // truncated with "..." | |
169 unsigned margin_before_collapse_ : 2; // EMarginCollapse | |
170 unsigned margin_after_collapse_ : 2; // EMarginCollapse | |
171 unsigned appearance_ : 6; // EAppearance | |
172 | |
173 unsigned text_decoration_style_ : 3; // TextDecorationStyle | |
174 | |
175 unsigned has_current_opacity_animation_ : 1; | |
176 unsigned has_current_transform_animation_ : 1; | |
177 unsigned has_current_filter_animation_ : 1; | |
178 unsigned has_current_backdrop_filter_animation_ : 1; | |
179 unsigned running_opacity_animation_on_compositor_ : 1; | |
180 unsigned running_transform_animation_on_compositor_ : 1; | |
181 unsigned running_filter_animation_on_compositor_ : 1; | |
182 unsigned running_backdrop_filter_animation_on_compositor_ : 1; | |
183 | |
184 unsigned is_stacking_context_ : 1; | |
185 | |
186 unsigned effective_blend_mode_ : 5; // EBlendMode | |
187 | |
188 unsigned touch_action_ : kTouchActionBits; // TouchAction | |
189 | |
190 unsigned object_fit_ : 3; // ObjectFit | |
191 | |
192 unsigned isolation_ : 1; // Isolation | |
193 | |
194 unsigned contain_ : 4; // Containment | |
195 | |
196 // ScrollBehavior. 'scroll-behavior' has 2 accepted values, but ScrollBehavior | |
197 // has a third value (that can only be specified using CSSOM scroll APIs) so 2 | |
198 // bits are needed. | |
199 unsigned scroll_behavior_ : 2; | |
200 | |
201 unsigned scroll_snap_type_ : 2; // ScrollSnapType | |
202 | |
203 // Plugins require accelerated compositing for reasons external to blink. | |
204 // In which case, we need to update the ComputedStyle on the | |
205 // LayoutEmbeddedObject, so store this bit so that the style actually changes | |
206 // when the plugin becomes composited. | |
207 unsigned requires_accelerated_compositing_for_external_reasons_ : 1; | |
208 | |
209 // Whether the transform (if it exists) is stored in the element's inline | |
210 // style. | |
211 unsigned has_inline_transform_ : 1; | |
212 unsigned resize_ : 2; // EResize | |
213 unsigned has_compositor_proxy_ : 1; | |
214 | |
215 // Style adjustment for appearance is disabled when certain properties are | |
216 // set. | |
217 unsigned has_author_background_ : 1; // Whether there is a author-defined | |
218 // background. | |
219 unsigned has_author_border_ : 1; // Whether there is a author-defined border. | |
220 | |
221 private: | |
222 StyleRareNonInheritedData(); | |
223 StyleRareNonInheritedData(const StyleRareNonInheritedData&); | |
224 }; | |
225 | |
226 } // namespace blink | |
227 | |
228 #endif // StyleRareNonInheritedData_h | |
OLD | NEW |