OLD | NEW |
| (Empty) |
1 /* | |
2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) | |
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights | |
4 * 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 | |
23 #include "core/style/StyleRareInheritedData.h" | |
24 | |
25 #include "core/style/AppliedTextDecoration.h" | |
26 #include "core/style/CursorData.h" | |
27 #include "core/style/DataEquivalency.h" | |
28 #include "core/style/ComputedStyle.h" | |
29 #include "core/style/ComputedStyleConstants.h" | |
30 #include "core/style/QuotesData.h" | |
31 #include "core/style/ShadowList.h" | |
32 #include "core/style/StyleImage.h" | |
33 #include "core/style/StyleInheritedVariables.h" | |
34 | |
35 namespace blink { | |
36 | |
37 struct SameSizeAsStyleRareInheritedData | |
38 : public RefCounted<SameSizeAsStyleRareInheritedData> { | |
39 void* style_image; | |
40 Color first_color; | |
41 float first_float; | |
42 Color colors[7]; | |
43 void* own_ptrs[1]; | |
44 AtomicString atomic_strings[3]; | |
45 void* ref_ptrs[1]; | |
46 Persistent<void*> persistent_handles[2]; | |
47 Length lengths[1]; | |
48 float second_float; | |
49 unsigned bitfields_[2]; | |
50 short paged_media_shorts[2]; | |
51 short hyphenation_shorts[3]; | |
52 uint8_t line_height_step; | |
53 | |
54 Color touch_colors; | |
55 TabSize tab_size; | |
56 void* variables[1]; | |
57 TextSizeAdjust text_size_adjust; | |
58 }; | |
59 | |
60 static_assert(sizeof(StyleRareInheritedData) <= | |
61 sizeof(SameSizeAsStyleRareInheritedData), | |
62 "StyleRareInheritedData should stay small"); | |
63 | |
64 StyleRareInheritedData::StyleRareInheritedData() | |
65 : list_style_image_(ComputedStyle::InitialListStyleImage()), | |
66 text_stroke_width_(ComputedStyle::InitialTextStrokeWidth()), | |
67 text_indent_(ComputedStyle::InitialTextIndent()), | |
68 effective_zoom_(ComputedStyle::InitialZoom()), | |
69 widows_(ComputedStyle::InitialWidows()), | |
70 orphans_(ComputedStyle::InitialOrphans()), | |
71 text_stroke_color_is_current_color_(true), | |
72 text_fill_color_is_current_color_(true), | |
73 text_emphasis_color_is_current_color_(true), | |
74 caret_color_is_current_color_(false), | |
75 caret_color_is_auto_(true), | |
76 visited_link_text_stroke_color_is_current_color_(true), | |
77 visited_link_text_fill_color_is_current_color_(true), | |
78 visited_link_text_emphasis_color_is_current_color_(true), | |
79 visited_link_caret_color_is_current_color_(false), | |
80 visited_link_caret_color_is_auto_(true), | |
81 text_security_( | |
82 static_cast<unsigned>(ComputedStyle::InitialTextSecurity())), | |
83 user_modify_(static_cast<unsigned>(EUserModify::kReadOnly)), | |
84 word_break_(static_cast<unsigned>(ComputedStyle::InitialWordBreak())), | |
85 overflow_wrap_( | |
86 static_cast<unsigned>(ComputedStyle::InitialOverflowWrap())), | |
87 line_break_(static_cast<unsigned>(LineBreak::kAuto)), | |
88 user_select_(static_cast<unsigned>(ComputedStyle::InitialUserSelect())), | |
89 speak_(static_cast<unsigned>(ESpeak::kNormal)), | |
90 hyphens_(static_cast<unsigned>(Hyphens::kManual)), | |
91 text_emphasis_fill_(kTextEmphasisFillFilled), | |
92 text_emphasis_mark_(kTextEmphasisMarkNone), | |
93 text_emphasis_position_(kTextEmphasisPositionOver), | |
94 text_align_last_(ComputedStyle::InitialTextAlignLast()), | |
95 text_justify_(ComputedStyle::InitialTextJustify()), | |
96 text_orientation_(kTextOrientationMixed), | |
97 text_combine_(ComputedStyle::InitialTextCombine()), | |
98 text_indent_line_(ComputedStyle::InitialTextIndentLine()), | |
99 text_indent_type_(ComputedStyle::InitialTextIndentLine()), | |
100 image_rendering_(ComputedStyle::InitialImageRendering()), | |
101 text_underline_position_(ComputedStyle::InitialTextUnderlinePosition()), | |
102 text_decoration_skip_(ComputedStyle::InitialTextDecorationSkip()), | |
103 ruby_position_(ComputedStyle::InitialRubyPosition()), | |
104 subtree_will_change_contents_(false), | |
105 self_or_ancestor_has_dir_auto_attribute_(false), | |
106 respect_image_orientation_(false), | |
107 subtree_is_sticky_(false), | |
108 hyphenation_limit_before_(-1), | |
109 hyphenation_limit_after_(-1), | |
110 hyphenation_limit_lines_(-1), | |
111 line_height_step_(0), | |
112 tap_highlight_color_(ComputedStyle::InitialTapHighlightColor()), | |
113 tab_size_(ComputedStyle::InitialTabSize()), | |
114 text_size_adjust_(ComputedStyle::InitialTextSizeAdjust()) {} | |
115 | |
116 bool StyleRareInheritedData::operator==(const StyleRareInheritedData& o) const { | |
117 return text_stroke_color_ == o.text_stroke_color_ && | |
118 text_stroke_width_ == o.text_stroke_width_ && | |
119 text_fill_color_ == o.text_fill_color_ && | |
120 text_emphasis_color_ == o.text_emphasis_color_ && | |
121 caret_color_ == o.caret_color_ && | |
122 visited_link_text_stroke_color_ == o.visited_link_text_stroke_color_ && | |
123 visited_link_text_fill_color_ == o.visited_link_text_fill_color_ && | |
124 visited_link_text_emphasis_color_ == | |
125 o.visited_link_text_emphasis_color_ && | |
126 visited_link_caret_color_ == o.visited_link_caret_color_ && | |
127 tap_highlight_color_ == o.tap_highlight_color_ && | |
128 DataEquivalent(text_shadow_, o.text_shadow_) && | |
129 highlight_ == o.highlight_ && | |
130 DataEquivalent(cursor_data_, o.cursor_data_) && | |
131 text_indent_ == o.text_indent_ && | |
132 effective_zoom_ == o.effective_zoom_ && widows_ == o.widows_ && | |
133 orphans_ == o.orphans_ && | |
134 text_stroke_color_is_current_color_ == | |
135 o.text_stroke_color_is_current_color_ && | |
136 text_fill_color_is_current_color_ == | |
137 o.text_fill_color_is_current_color_ && | |
138 text_emphasis_color_is_current_color_ == | |
139 o.text_emphasis_color_is_current_color_ && | |
140 caret_color_is_current_color_ == o.caret_color_is_current_color_ && | |
141 caret_color_is_auto_ == o.caret_color_is_auto_ && | |
142 visited_link_text_stroke_color_is_current_color_ == | |
143 o.visited_link_text_stroke_color_is_current_color_ && | |
144 visited_link_text_fill_color_is_current_color_ == | |
145 o.visited_link_text_fill_color_is_current_color_ && | |
146 visited_link_text_emphasis_color_is_current_color_ == | |
147 o.visited_link_text_emphasis_color_is_current_color_ && | |
148 visited_link_caret_color_is_current_color_ == | |
149 o.visited_link_caret_color_is_current_color_ && | |
150 visited_link_caret_color_is_auto_ == | |
151 o.visited_link_caret_color_is_auto_ && | |
152 text_security_ == o.text_security_ && user_modify_ == o.user_modify_ && | |
153 word_break_ == o.word_break_ && overflow_wrap_ == o.overflow_wrap_ && | |
154 line_break_ == o.line_break_ && user_select_ == o.user_select_ && | |
155 speak_ == o.speak_ && hyphens_ == o.hyphens_ && | |
156 hyphenation_limit_before_ == o.hyphenation_limit_before_ && | |
157 hyphenation_limit_after_ == o.hyphenation_limit_after_ && | |
158 hyphenation_limit_lines_ == o.hyphenation_limit_lines_ && | |
159 text_emphasis_fill_ == o.text_emphasis_fill_ && | |
160 text_emphasis_mark_ == o.text_emphasis_mark_ && | |
161 text_emphasis_position_ == o.text_emphasis_position_ && | |
162 text_align_last_ == o.text_align_last_ && | |
163 text_justify_ == o.text_justify_ && | |
164 text_orientation_ == o.text_orientation_ && | |
165 text_combine_ == o.text_combine_ && | |
166 text_indent_line_ == o.text_indent_line_ && | |
167 text_indent_type_ == o.text_indent_type_ && | |
168 subtree_will_change_contents_ == o.subtree_will_change_contents_ && | |
169 self_or_ancestor_has_dir_auto_attribute_ == | |
170 o.self_or_ancestor_has_dir_auto_attribute_ && | |
171 respect_image_orientation_ == o.respect_image_orientation_ && | |
172 subtree_is_sticky_ == o.subtree_is_sticky_ && | |
173 hyphenation_string_ == o.hyphenation_string_ && | |
174 line_height_step_ == o.line_height_step_ && | |
175 text_emphasis_custom_mark_ == o.text_emphasis_custom_mark_ && | |
176 DataEquivalent(quotes_, o.quotes_) && tab_size_ == o.tab_size_ && | |
177 image_rendering_ == o.image_rendering_ && | |
178 text_underline_position_ == o.text_underline_position_ && | |
179 text_decoration_skip_ == o.text_decoration_skip_ && | |
180 ruby_position_ == o.ruby_position_ && | |
181 DataEquivalent(list_style_image_, o.list_style_image_) && | |
182 DataEquivalent(applied_text_decorations_, | |
183 o.applied_text_decorations_) && | |
184 DataEquivalent(variables_, o.variables_) && | |
185 text_size_adjust_ == o.text_size_adjust_; | |
186 } | |
187 | |
188 } // namespace blink | |
OLD | NEW |