OLD | NEW |
| (Empty) |
1 /* | |
2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) | |
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | |
4 * | |
5 * This library is free software; you can redistribute it and/or | |
6 * modify it under the terms of the GNU Library General Public | |
7 * License as published by the Free Software Foundation; either | |
8 * version 2 of the License, or (at your option) any later version. | |
9 * | |
10 * This library is distributed in the hope that it will be useful, | |
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 * Library General Public License for more details. | |
14 * | |
15 * You should have received a copy of the GNU Library General Public License | |
16 * along with this library; see the file COPYING.LIB. If not, write to | |
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | |
18 * Boston, MA 02110-1301, USA. | |
19 * | |
20 */ | |
21 | |
22 #include "core/style/StyleRareNonInheritedData.h" | |
23 | |
24 #include "core/animation/css/CSSAnimationData.h" | |
25 #include "core/animation/css/CSSTransitionData.h" | |
26 #include "core/style/ComputedStyle.h" | |
27 #include "core/style/ContentData.h" | |
28 #include "core/style/DataEquivalency.h" | |
29 #include "core/style/MemberCopy.h" | |
30 #include "core/style/ShadowList.h" | |
31 #include "core/style/StyleFilterData.h" | |
32 #include "core/style/StyleNonInheritedVariables.h" | |
33 #include "core/style/StyleTransformData.h" | |
34 | |
35 namespace blink { | |
36 | |
37 class SameSizeStyleRareNonInheritedData | |
38 : public RefCounted<StyleRareNonInheritedData> { | |
39 public: | |
40 float floats[3]; | |
41 int integers; | |
42 | |
43 LengthPoint length_points[2]; | |
44 LineClampValue line_clamps; | |
45 DraggableRegionMode draggable_regions; | |
46 | |
47 void* data_refs[8]; | |
48 DataPersistent<void*> data_persistents[2]; | |
49 void* own_ptrs[4]; | |
50 Persistent<void*> persistent_handles[2]; | |
51 void* ref_ptrs[3]; | |
52 void* unique_ptrs[1]; | |
53 | |
54 FillLayer fill_layers; | |
55 NinePieceImage nine_pieces; | |
56 FloatSize float_size; | |
57 Length lengths; | |
58 OutlineValue outline; | |
59 | |
60 StyleColor style_colors[8]; | |
61 | |
62 Vector<String> callback_selectors_; | |
63 | |
64 StyleContentAlignmentData content_alignment_data[2]; | |
65 StyleSelfAlignmentData self_alignment_data[4]; | |
66 | |
67 unsigned bit_fields_[2]; | |
68 }; | |
69 | |
70 static_assert(sizeof(StyleRareNonInheritedData) == | |
71 sizeof(SameSizeStyleRareNonInheritedData), | |
72 "StyleRareNonInheritedData_should_stay_small"); | |
73 | |
74 StyleRareNonInheritedData::StyleRareNonInheritedData() | |
75 : opacity_(ComputedStyle::InitialOpacity()), | |
76 perspective_(ComputedStyle::InitialPerspective()), | |
77 shape_image_threshold_(ComputedStyle::InitialShapeImageThreshold()), | |
78 order_(ComputedStyle::InitialOrder()), | |
79 perspective_origin_(ComputedStyle::InitialPerspectiveOrigin()), | |
80 object_position_(ComputedStyle::InitialObjectPosition()), | |
81 line_clamp_(ComputedStyle::InitialLineClamp()), | |
82 draggable_region_mode_(static_cast<unsigned>(kDraggableRegionNone)), | |
83 shape_outside_(ComputedStyle::InitialShapeOutside()), | |
84 clip_path_(ComputedStyle::InitialClipPath()), | |
85 mask_(kMaskFillLayer, true), | |
86 mask_box_image_(NinePieceImage::MaskDefaults()), | |
87 page_size_(), | |
88 shape_margin_(ComputedStyle::InitialShapeMargin()), | |
89 text_decoration_color_(StyleColor::CurrentColor()), | |
90 visited_link_text_decoration_color_(StyleColor::CurrentColor()), | |
91 visited_link_background_color_(ComputedStyle::InitialBackgroundColor()), | |
92 visited_link_outline_color_(StyleColor::CurrentColor()), | |
93 visited_link_border_left_color_(StyleColor::CurrentColor()), | |
94 visited_link_border_right_color_(StyleColor::CurrentColor()), | |
95 visited_link_border_top_color_(StyleColor::CurrentColor()), | |
96 visited_link_border_bottom_color_(StyleColor::CurrentColor()), | |
97 non_inherited_variables_(ComputedStyle::InitialNonInheritedVariables()), | |
98 align_content_(ComputedStyle::InitialContentAlignment()), | |
99 align_items_(ComputedStyle::InitialDefaultAlignment()), | |
100 align_self_(ComputedStyle::InitialSelfAlignment()), | |
101 justify_content_(ComputedStyle::InitialContentAlignment()), | |
102 justify_items_(ComputedStyle::InitialSelfAlignment()), | |
103 justify_self_(ComputedStyle::InitialSelfAlignment()), | |
104 page_size_type_(static_cast<unsigned>(PageSizeType::kAuto)), | |
105 transform_style_3d_(ComputedStyle::InitialTransformStyle3D()), | |
106 backface_visibility_(ComputedStyle::InitialBackfaceVisibility()), | |
107 user_drag_(ComputedStyle::InitialUserDrag()), | |
108 text_overflow_(ComputedStyle::InitialTextOverflow()), | |
109 margin_before_collapse_(kMarginCollapseCollapse), | |
110 margin_after_collapse_(kMarginCollapseCollapse), | |
111 appearance_(ComputedStyle::InitialAppearance()), | |
112 text_decoration_style_(ComputedStyle::InitialTextDecorationStyle()), | |
113 has_current_opacity_animation_(false), | |
114 has_current_transform_animation_(false), | |
115 has_current_filter_animation_(false), | |
116 has_current_backdrop_filter_animation_(false), | |
117 running_opacity_animation_on_compositor_(false), | |
118 running_transform_animation_on_compositor_(false), | |
119 running_filter_animation_on_compositor_(false), | |
120 running_backdrop_filter_animation_on_compositor_(false), | |
121 is_stacking_context_(false), | |
122 effective_blend_mode_(ComputedStyle::InitialBlendMode()), | |
123 touch_action_(ComputedStyle::InitialTouchAction()), | |
124 object_fit_(ComputedStyle::InitialObjectFit()), | |
125 isolation_(ComputedStyle::InitialIsolation()), | |
126 contain_(ComputedStyle::InitialContain()), | |
127 scroll_behavior_(ComputedStyle::InitialScrollBehavior()), | |
128 scroll_snap_type_(ComputedStyle::InitialScrollSnapType()), | |
129 requires_accelerated_compositing_for_external_reasons_(false), | |
130 has_inline_transform_(false), | |
131 resize_(ComputedStyle::InitialResize()), | |
132 has_compositor_proxy_(false), | |
133 has_author_background_(false), | |
134 has_author_border_(false) {} | |
135 | |
136 StyleRareNonInheritedData::StyleRareNonInheritedData( | |
137 const StyleRareNonInheritedData& o) | |
138 : RefCounted<StyleRareNonInheritedData>(), | |
139 opacity_(o.opacity_), | |
140 perspective_(o.perspective_), | |
141 shape_image_threshold_(o.shape_image_threshold_), | |
142 order_(o.order_), | |
143 perspective_origin_(o.perspective_origin_), | |
144 object_position_(o.object_position_), | |
145 line_clamp_(o.line_clamp_), | |
146 draggable_region_mode_(o.draggable_region_mode_), | |
147 deprecated_flexible_box_data_( | |
148 MemberCopy(o.deprecated_flexible_box_data_)), | |
149 flexible_box_data_(MemberCopy(o.flexible_box_data_)), | |
150 multi_col_data_(MemberCopy(o.multi_col_data_)), | |
151 transform_data_(MemberCopy(o.transform_data_)), | |
152 will_change_data_(MemberCopy(o.will_change_data_)), | |
153 filter_(MemberCopy(o.filter_)), | |
154 backdrop_filter_(MemberCopy(o.backdrop_filter_)), | |
155 grid_data_(MemberCopy(o.grid_data_)), | |
156 grid_item_data_(MemberCopy(o.grid_item_data_)), | |
157 scroll_snap_data_(MemberCopy(o.scroll_snap_data_)), | |
158 content_(MemberCopy(o.content_)), | |
159 counter_directives_(MemberCopy(o.counter_directives_)), | |
160 animations_(MemberCopy(o.animations_)), | |
161 transitions_(MemberCopy(o.transitions_)), | |
162 box_shadow_(MemberCopy(o.box_shadow_)), | |
163 box_reflect_(MemberCopy(o.box_reflect_)), | |
164 shape_outside_(o.shape_outside_), | |
165 clip_path_(MemberCopy(o.clip_path_)), | |
166 mask_(o.mask_), | |
167 mask_box_image_(o.mask_box_image_), | |
168 page_size_(o.page_size_), | |
169 shape_margin_(o.shape_margin_), | |
170 outline_(o.outline_), | |
171 text_decoration_color_(o.text_decoration_color_), | |
172 visited_link_text_decoration_color_( | |
173 o.visited_link_text_decoration_color_), | |
174 visited_link_background_color_(o.visited_link_background_color_), | |
175 visited_link_outline_color_(o.visited_link_outline_color_), | |
176 visited_link_border_left_color_(o.visited_link_border_left_color_), | |
177 visited_link_border_right_color_(o.visited_link_border_right_color_), | |
178 visited_link_border_top_color_(o.visited_link_border_top_color_), | |
179 visited_link_border_bottom_color_(o.visited_link_border_bottom_color_), | |
180 callback_selectors_(o.callback_selectors_), | |
181 paint_images_(MemberCopy(o.paint_images_)), | |
182 non_inherited_variables_(MemberCopy(o.non_inherited_variables_)), | |
183 align_content_(o.align_content_), | |
184 align_items_(o.align_items_), | |
185 align_self_(o.align_self_), | |
186 justify_content_(o.justify_content_), | |
187 justify_items_(o.justify_items_), | |
188 justify_self_(o.justify_self_), | |
189 page_size_type_(o.page_size_type_), | |
190 transform_style_3d_(o.transform_style_3d_), | |
191 backface_visibility_(o.backface_visibility_), | |
192 user_drag_(o.user_drag_), | |
193 text_overflow_(o.text_overflow_), | |
194 margin_before_collapse_(o.margin_before_collapse_), | |
195 margin_after_collapse_(o.margin_after_collapse_), | |
196 appearance_(o.appearance_), | |
197 text_decoration_style_(o.text_decoration_style_), | |
198 has_current_opacity_animation_(o.has_current_opacity_animation_), | |
199 has_current_transform_animation_(o.has_current_transform_animation_), | |
200 has_current_filter_animation_(o.has_current_filter_animation_), | |
201 has_current_backdrop_filter_animation_( | |
202 o.has_current_backdrop_filter_animation_), | |
203 running_opacity_animation_on_compositor_( | |
204 o.running_opacity_animation_on_compositor_), | |
205 running_transform_animation_on_compositor_( | |
206 o.running_transform_animation_on_compositor_), | |
207 running_filter_animation_on_compositor_( | |
208 o.running_filter_animation_on_compositor_), | |
209 running_backdrop_filter_animation_on_compositor_( | |
210 o.running_backdrop_filter_animation_on_compositor_), | |
211 is_stacking_context_(o.is_stacking_context_), | |
212 effective_blend_mode_(o.effective_blend_mode_), | |
213 touch_action_(o.touch_action_), | |
214 object_fit_(o.object_fit_), | |
215 isolation_(o.isolation_), | |
216 contain_(o.contain_), | |
217 scroll_behavior_(o.scroll_behavior_), | |
218 scroll_snap_type_(o.scroll_snap_type_), | |
219 requires_accelerated_compositing_for_external_reasons_( | |
220 o.requires_accelerated_compositing_for_external_reasons_), | |
221 has_inline_transform_(o.has_inline_transform_), | |
222 resize_(o.resize_), | |
223 has_compositor_proxy_(o.has_compositor_proxy_), | |
224 has_author_background_(o.has_author_background_), | |
225 has_author_border_(o.has_author_border_) {} | |
226 | |
227 StyleRareNonInheritedData::~StyleRareNonInheritedData() {} | |
228 | |
229 bool StyleRareNonInheritedData::operator==( | |
230 const StyleRareNonInheritedData& o) const { | |
231 return opacity_ == o.opacity_ && perspective_ == o.perspective_ && | |
232 shape_image_threshold_ == o.shape_image_threshold_ && | |
233 order_ == o.order_ && perspective_origin_ == o.perspective_origin_ && | |
234 object_position_ == o.object_position_ && | |
235 line_clamp_ == o.line_clamp_ && | |
236 draggable_region_mode_ == o.draggable_region_mode_ && | |
237 DataEquivalent(deprecated_flexible_box_data_, | |
238 o.deprecated_flexible_box_data_) && | |
239 DataEquivalent(flexible_box_data_, o.flexible_box_data_) && | |
240 DataEquivalent(multi_col_data_, o.multi_col_data_) && | |
241 DataEquivalent(transform_data_, o.transform_data_) && | |
242 DataEquivalent(will_change_data_, o.will_change_data_) && | |
243 DataEquivalent(filter_, o.filter_) && | |
244 DataEquivalent(backdrop_filter_, o.backdrop_filter_) && | |
245 DataEquivalent(grid_data_, o.grid_data_) && | |
246 DataEquivalent(grid_item_data_, o.grid_item_data_) && | |
247 DataEquivalent(scroll_snap_data_, o.scroll_snap_data_) && | |
248 DataEquivalent(content_, o.content_) && | |
249 DataEquivalent(counter_directives_, o.counter_directives_) && | |
250 DataEquivalent(box_shadow_, o.box_shadow_) && | |
251 DataEquivalent(box_reflect_, o.box_reflect_) && | |
252 DataEquivalent(animations_, o.animations_) && | |
253 DataEquivalent(transitions_, o.transitions_) && | |
254 DataEquivalent(shape_outside_, o.shape_outside_) && mask_ == o.mask_ && | |
255 mask_box_image_ == o.mask_box_image_ && page_size_ == o.page_size_ && | |
256 shape_margin_ == o.shape_margin_ && outline_ == o.outline_ && | |
257 DataEquivalent(clip_path_, o.clip_path_) && | |
258 text_decoration_color_ == o.text_decoration_color_ && | |
259 visited_link_text_decoration_color_ == | |
260 o.visited_link_text_decoration_color_ && | |
261 visited_link_background_color_ == o.visited_link_background_color_ && | |
262 visited_link_outline_color_ == o.visited_link_outline_color_ && | |
263 visited_link_border_left_color_ == o.visited_link_border_left_color_ && | |
264 visited_link_border_right_color_ == | |
265 o.visited_link_border_right_color_ && | |
266 visited_link_border_top_color_ == o.visited_link_border_top_color_ && | |
267 visited_link_border_bottom_color_ == | |
268 o.visited_link_border_bottom_color_ && | |
269 callback_selectors_ == o.callback_selectors_ && | |
270 DataEquivalent(non_inherited_variables_, o.non_inherited_variables_) && | |
271 align_content_ == o.align_content_ && align_items_ == o.align_items_ && | |
272 align_self_ == o.align_self_ && | |
273 justify_content_ == o.justify_content_ && | |
274 justify_items_ == o.justify_items_ && | |
275 justify_self_ == o.justify_self_ && | |
276 page_size_type_ == o.page_size_type_ && | |
277 transform_style_3d_ == o.transform_style_3d_ && | |
278 backface_visibility_ == o.backface_visibility_ && | |
279 user_drag_ == o.user_drag_ && text_overflow_ == o.text_overflow_ && | |
280 margin_before_collapse_ == o.margin_before_collapse_ && | |
281 margin_after_collapse_ == o.margin_after_collapse_ && | |
282 appearance_ == o.appearance_ && | |
283 text_decoration_style_ == o.text_decoration_style_ && | |
284 has_current_opacity_animation_ == o.has_current_opacity_animation_ && | |
285 has_current_transform_animation_ == | |
286 o.has_current_transform_animation_ && | |
287 has_current_filter_animation_ == o.has_current_filter_animation_ && | |
288 has_current_backdrop_filter_animation_ == | |
289 o.has_current_backdrop_filter_animation_ && | |
290 is_stacking_context_ == o.is_stacking_context_ && | |
291 effective_blend_mode_ == o.effective_blend_mode_ && | |
292 touch_action_ == o.touch_action_ && object_fit_ == o.object_fit_ && | |
293 isolation_ == o.isolation_ && contain_ == o.contain_ && | |
294 scroll_behavior_ == o.scroll_behavior_ && | |
295 scroll_snap_type_ == o.scroll_snap_type_ && | |
296 requires_accelerated_compositing_for_external_reasons_ == | |
297 o.requires_accelerated_compositing_for_external_reasons_ && | |
298 has_inline_transform_ == o.has_inline_transform_ && | |
299 resize_ == o.resize_ && | |
300 has_compositor_proxy_ == o.has_compositor_proxy_ && | |
301 has_author_background_ == o.has_author_background_ && | |
302 has_author_border_ == o.has_author_border_; | |
303 } | |
304 | |
305 } // namespace blink | |
OLD | NEW |