Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(129)

Side by Side Diff: third_party/WebKit/Source/core/style/StyleRareInheritedData.h

Issue 2885033006: Move StyleRareInheritedData.cpp to be inline in StyleRareInheritedData.h (Closed)
Patch Set: Rebase Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
3 * (C) 2000 Antti Koivisto (koivisto@kde.org) 3 * (C) 2000 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) 6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 10 matching lines...) Expand all
21 * Boston, MA 02110-1301, USA. 21 * Boston, MA 02110-1301, USA.
22 * 22 *
23 */ 23 */
24 24
25 #ifndef StyleRareInheritedData_h 25 #ifndef StyleRareInheritedData_h
26 #define StyleRareInheritedData_h 26 #define StyleRareInheritedData_h
27 27
28 #include "core/CoreExport.h" 28 #include "core/CoreExport.h"
29 #include "core/css/StyleAutoColor.h" 29 #include "core/css/StyleAutoColor.h"
30 #include "core/css/StyleColor.h" 30 #include "core/css/StyleColor.h"
31 #include "core/layout/LayoutTheme.h"
31 #include "core/style/AppliedTextDecoration.h" 32 #include "core/style/AppliedTextDecoration.h"
32 #include "core/style/AppliedTextDecorationList.h" 33 #include "core/style/AppliedTextDecorationList.h"
33 #include "core/style/CursorData.h" 34 #include "core/style/CursorData.h"
34 #include "core/style/CursorList.h" 35 #include "core/style/CursorList.h"
35 #include "core/style/QuotesData.h" 36 #include "core/style/QuotesData.h"
36 #include "core/style/ShadowData.h" 37 #include "core/style/ShadowData.h"
37 #include "core/style/ShadowList.h" 38 #include "core/style/ShadowList.h"
38 #include "core/style/StyleImage.h" 39 #include "core/style/StyleImage.h"
39 #include "core/style/StyleInheritedVariables.h" 40 #include "core/style/StyleInheritedVariables.h"
40 #include "core/style/TextSizeAdjust.h" 41 #include "core/style/TextSizeAdjust.h"
41 #include "platform/Length.h" 42 #include "platform/Length.h"
42 #include "platform/graphics/Color.h" 43 #include "platform/graphics/Color.h"
43 #include "platform/heap/Handle.h" 44 #include "platform/heap/Handle.h"
44 #include "platform/text/TabSize.h" 45 #include "platform/text/TabSize.h"
45 #include "platform/wtf/PassRefPtr.h" 46 #include "platform/wtf/PassRefPtr.h"
46 #include "platform/wtf/RefCounted.h" 47 #include "platform/wtf/RefCounted.h"
47 #include "platform/wtf/RefVector.h" 48 #include "platform/wtf/RefVector.h"
48 #include "platform/wtf/text/AtomicString.h" 49 #include "platform/wtf/text/AtomicString.h"
49 50
50 namespace blink { 51 namespace blink {
51 52
52 class QuotesData;
53 class ShadowList;
54 class StyleImage;
55 class StyleInheritedVariables;
56
57 // This struct is for rarely used inherited CSS3, CSS2, and WebKit-specific 53 // This struct is for rarely used inherited CSS3, CSS2, and WebKit-specific
58 // properties. By grouping them together, we save space, and only allocate this 54 // properties. By grouping them together, we save space, and only allocate this
59 // object when someone actually uses one of these properties. 55 // object when someone actually uses one of these properties.
60 // TODO(sashab): Move this into a private class on ComputedStyle, and remove 56 // TODO(sashab): Move this into a private class on ComputedStyle, and remove
61 // all methods on it, merging them into copy/creation methods on ComputedStyle 57 // all methods on it, merging them into copy/creation methods on ComputedStyle
62 // instead. Keep the allocation logic, only allocating a new object if needed. 58 // instead. Keep the allocation logic, only allocating a new object if needed.
63 class CORE_EXPORT StyleRareInheritedData 59 class CORE_EXPORT StyleRareInheritedData
64 : public RefCountedCopyable<StyleRareInheritedData> { 60 : public RefCountedCopyable<StyleRareInheritedData> {
65 public: 61 public:
66 static PassRefPtr<StyleRareInheritedData> Create() { 62 static PassRefPtr<StyleRareInheritedData> Create() {
67 return AdoptRef(new StyleRareInheritedData); 63 return AdoptRef(new StyleRareInheritedData);
68 } 64 }
69 PassRefPtr<StyleRareInheritedData> Copy() const { 65 PassRefPtr<StyleRareInheritedData> Copy() const {
70 return AdoptRef(new StyleRareInheritedData(*this)); 66 return AdoptRef(new StyleRareInheritedData(*this));
71 } 67 }
72 68
73 bool operator==(const StyleRareInheritedData&) const; 69 bool operator==(const StyleRareInheritedData& other) const {
70 return text_stroke_color_ == other.text_stroke_color_ &&
71 text_stroke_width_ == other.text_stroke_width_ &&
72 text_fill_color_ == other.text_fill_color_ &&
73 text_emphasis_color_ == other.text_emphasis_color_ &&
74 caret_color_ == other.caret_color_ &&
75 visited_link_text_stroke_color_ ==
76 other.visited_link_text_stroke_color_ &&
77 visited_link_text_fill_color_ ==
78 other.visited_link_text_fill_color_ &&
79 visited_link_text_emphasis_color_ ==
80 other.visited_link_text_emphasis_color_ &&
81 visited_link_caret_color_ == other.visited_link_caret_color_ &&
82 tap_highlight_color_ == other.tap_highlight_color_ &&
83 DataEquivalent(text_shadow_, other.text_shadow_) &&
84 highlight_ == other.highlight_ &&
85 DataEquivalent(cursor_data_, other.cursor_data_) &&
86 text_indent_ == other.text_indent_ &&
87 effective_zoom_ == other.effective_zoom_ &&
88 widows_ == other.widows_ && orphans_ == other.orphans_ &&
89 text_stroke_color_is_current_color_ ==
90 other.text_stroke_color_is_current_color_ &&
91 text_fill_color_is_current_color_ ==
92 other.text_fill_color_is_current_color_ &&
93 text_emphasis_color_is_current_color_ ==
94 other.text_emphasis_color_is_current_color_ &&
95 caret_color_is_current_color_ ==
96 other.caret_color_is_current_color_ &&
97 caret_color_is_auto_ == other.caret_color_is_auto_ &&
98 visited_link_text_stroke_color_is_current_color_ ==
99 other.visited_link_text_stroke_color_is_current_color_ &&
100 visited_link_text_fill_color_is_current_color_ ==
101 other.visited_link_text_fill_color_is_current_color_ &&
102 visited_link_text_emphasis_color_is_current_color_ ==
103 other.visited_link_text_emphasis_color_is_current_color_ &&
104 visited_link_caret_color_is_current_color_ ==
105 other.visited_link_caret_color_is_current_color_ &&
106 visited_link_caret_color_is_auto_ ==
107 other.visited_link_caret_color_is_auto_ &&
108 text_security_ == other.text_security_ &&
109 user_modify_ == other.user_modify_ &&
110 word_break_ == other.word_break_ &&
111 overflow_wrap_ == other.overflow_wrap_ &&
112 line_break_ == other.line_break_ &&
113 user_select_ == other.user_select_ && speak_ == other.speak_ &&
114 hyphens_ == other.hyphens_ &&
115 hyphenation_limit_before_ == other.hyphenation_limit_before_ &&
116 hyphenation_limit_after_ == other.hyphenation_limit_after_ &&
117 hyphenation_limit_lines_ == other.hyphenation_limit_lines_ &&
118 text_emphasis_fill_ == other.text_emphasis_fill_ &&
119 text_emphasis_mark_ == other.text_emphasis_mark_ &&
120 text_emphasis_position_ == other.text_emphasis_position_ &&
121 text_align_last_ == other.text_align_last_ &&
122 text_justify_ == other.text_justify_ &&
123 text_orientation_ == other.text_orientation_ &&
124 text_combine_ == other.text_combine_ &&
125 text_indent_line_ == other.text_indent_line_ &&
126 text_indent_type_ == other.text_indent_type_ &&
127 subtree_will_change_contents_ ==
128 other.subtree_will_change_contents_ &&
129 self_or_ancestor_has_dir_auto_attribute_ ==
130 other.self_or_ancestor_has_dir_auto_attribute_ &&
131 respect_image_orientation_ == other.respect_image_orientation_ &&
132 subtree_is_sticky_ == other.subtree_is_sticky_ &&
133 hyphenation_string_ == other.hyphenation_string_ &&
134 line_height_step_ == other.line_height_step_ &&
135 text_emphasis_custom_mark_ == other.text_emphasis_custom_mark_ &&
136 DataEquivalent(quotes_, other.quotes_) &&
137 tab_size_ == other.tab_size_ &&
138 image_rendering_ == other.image_rendering_ &&
139 text_underline_position_ == other.text_underline_position_ &&
140 text_decoration_skip_ == other.text_decoration_skip_ &&
141 ruby_position_ == other.ruby_position_ &&
142 DataEquivalent(list_style_image_, other.list_style_image_) &&
143 DataEquivalent(applied_text_decorations_,
144 other.applied_text_decorations_) &&
145 DataEquivalent(variables_, other.variables_) &&
146 text_size_adjust_ == other.text_size_adjust_;
147 }
74 bool operator!=(const StyleRareInheritedData& o) const { 148 bool operator!=(const StyleRareInheritedData& o) const {
75 return !(*this == o); 149 return !(*this == o);
76 } 150 }
77 151
78 Persistent<StyleImage> list_style_image_; 152 Persistent<StyleImage> list_style_image_;
79 153
80 Color text_stroke_color_; 154 Color text_stroke_color_;
81 float text_stroke_width_; 155 float text_stroke_width_;
82 Color text_fill_color_; 156 Color text_fill_color_;
83 Color text_emphasis_color_; 157 Color text_emphasis_color_;
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 234
161 Color tap_highlight_color_; 235 Color tap_highlight_color_;
162 236
163 RefPtr<AppliedTextDecorationList> applied_text_decorations_; 237 RefPtr<AppliedTextDecorationList> applied_text_decorations_;
164 TabSize tab_size_; 238 TabSize tab_size_;
165 239
166 RefPtr<StyleInheritedVariables> variables_; 240 RefPtr<StyleInheritedVariables> variables_;
167 TextSizeAdjust text_size_adjust_; 241 TextSizeAdjust text_size_adjust_;
168 242
169 private: 243 private:
170 StyleRareInheritedData(); 244 StyleRareInheritedData()
245 : list_style_image_(nullptr),
246 text_stroke_width_(0),
247 text_indent_(Length(kFixed)),
248 effective_zoom_(1.0),
249 widows_(2),
250 orphans_(2),
251 text_stroke_color_is_current_color_(true),
252 text_fill_color_is_current_color_(true),
253 text_emphasis_color_is_current_color_(true),
254 caret_color_is_current_color_(false),
255 caret_color_is_auto_(true),
256 visited_link_text_stroke_color_is_current_color_(true),
257 visited_link_text_fill_color_is_current_color_(true),
258 visited_link_text_emphasis_color_is_current_color_(true),
259 visited_link_caret_color_is_current_color_(false),
260 visited_link_caret_color_is_auto_(true),
261 text_security_(static_cast<unsigned>(ETextSecurity::kNone)),
262 user_modify_(static_cast<unsigned>(EUserModify::kReadOnly)),
263 word_break_(static_cast<unsigned>(EWordBreak::kNormal)),
264 overflow_wrap_(static_cast<unsigned>(EOverflowWrap::kNormal)),
265 line_break_(static_cast<unsigned>(LineBreak::kAuto)),
266 user_select_(static_cast<unsigned>(EUserSelect::kText)),
267 speak_(static_cast<unsigned>(ESpeak::kNormal)),
268 hyphens_(static_cast<unsigned>(Hyphens::kManual)),
269 text_emphasis_fill_(kTextEmphasisFillFilled),
270 text_emphasis_mark_(kTextEmphasisMarkNone),
271 text_emphasis_position_(kTextEmphasisPositionOver),
272 text_align_last_(kTextAlignLastAuto),
273 text_justify_(kTextJustifyAuto),
274 text_orientation_(kTextOrientationMixed),
275 text_combine_(kTextCombineNone),
276 text_indent_line_(kTextIndentFirstLine),
277 text_indent_type_(kTextIndentNormal),
278 image_rendering_(kImageRenderingAuto),
279 text_underline_position_(kTextUnderlinePositionAuto),
280 text_decoration_skip_(kTextDecorationSkipObjects),
281 ruby_position_(kRubyPositionBefore),
282 subtree_will_change_contents_(false),
283 self_or_ancestor_has_dir_auto_attribute_(false),
284 respect_image_orientation_(false),
285 subtree_is_sticky_(false),
286 hyphenation_limit_before_(-1),
287 hyphenation_limit_after_(-1),
288 hyphenation_limit_lines_(-1),
289 line_height_step_(0),
290 tap_highlight_color_(LayoutTheme::TapHighlightColor()),
291 tab_size_(TabSize(8)),
292 text_size_adjust_(TextSizeAdjust::AdjustAuto()) {}
293
171 StyleRareInheritedData(const StyleRareInheritedData&) = default; 294 StyleRareInheritedData(const StyleRareInheritedData&) = default;
172 }; 295 };
173 296
174 } // namespace blink 297 } // namespace blink
175 298
176 #endif // StyleRareInheritedData_h 299 #endif // StyleRareInheritedData_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/style/BUILD.gn ('k') | third_party/WebKit/Source/core/style/StyleRareInheritedData.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698