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

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

Issue 2886363003: Remove unused handwritten StyleInheritedData in ComputedStyle. (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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, 2009, 2010, 2011 Apple Inc. All 5 * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
6 * rights reserved. 6 * rights reserved.
7 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) 7 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com)
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 friend class ColorPropertyFunctions; 172 friend class ColorPropertyFunctions;
173 173
174 // FIXME: When we stop resolving currentColor at style time, these can be 174 // FIXME: When we stop resolving currentColor at style time, these can be
175 // removed. 175 // removed.
176 friend class CSSToStyleMap; 176 friend class CSSToStyleMap;
177 friend class FilterOperationResolver; 177 friend class FilterOperationResolver;
178 friend class StyleBuilderConverter; 178 friend class StyleBuilderConverter;
179 friend class StyleResolverState; 179 friend class StyleResolverState;
180 friend class StyleResolver; 180 friend class StyleResolver;
181 181
182 private:
183 class StyleInheritedData : public RefCountedCopyable<StyleInheritedData> {
184 public:
185 static PassRefPtr<StyleInheritedData> Create() {
186 return AdoptRef(new StyleInheritedData);
187 }
188 PassRefPtr<StyleInheritedData> Copy() const {
189 return AdoptRef(new StyleInheritedData(*this));
190 }
191
192 bool operator==(const StyleInheritedData& other) const {
193 return line_height_ == other.line_height_ && font_ == other.font_ &&
194 color_ == other.color_ &&
195 visited_link_color_ == other.visited_link_color_ &&
196 horizontal_border_spacing_ == other.horizontal_border_spacing_ &&
197 text_autosizing_multiplier_ == other.text_autosizing_multiplier_ &&
198 vertical_border_spacing_ == other.vertical_border_spacing_;
199 }
200 bool operator!=(const StyleInheritedData& o) const { return !(*this == o); }
201
202 short horizontal_border_spacing_;
203 short vertical_border_spacing_;
204
205 // could be packed in a short but doesn't
206 // make a difference currently because of padding
207 Length line_height_;
208
209 Font font_;
210 Color color_;
211 Color visited_link_color_;
212 float text_autosizing_multiplier_;
213
214 private:
215 StyleInheritedData()
216 : horizontal_border_spacing_(0),
217 vertical_border_spacing_(0),
218 line_height_(Length(-100.0, kPercent)),
219 color_(Color::kBlack),
220 visited_link_color_(Color::kBlack),
221 text_autosizing_multiplier_(1) {}
222
223 StyleInheritedData(const StyleInheritedData&) = default;
224 };
225
226 protected: 182 protected:
227 // non-inherited attributes 183 // non-inherited attributes
228 DataRef<StyleRareNonInheritedData> rare_non_inherited_data_; 184 DataRef<StyleRareNonInheritedData> rare_non_inherited_data_;
229 185
230 // inherited attributes 186 // inherited attributes
231 DataRef<StyleRareInheritedData> rare_inherited_data_; 187 DataRef<StyleRareInheritedData> rare_inherited_data_;
232 188
233 // list of associated pseudo styles 189 // list of associated pseudo styles
234 std::unique_ptr<PseudoStyleCache> cached_pseudo_styles_; 190 std::unique_ptr<PseudoStyleCache> cached_pseudo_styles_;
235 191
(...skipping 3562 matching lines...) Expand 10 before | Expand all | Expand 10 after
3798 PseudoBitsInternal() | 1 << (pseudo - kFirstPublicPseudoId))); 3754 PseudoBitsInternal() | 1 << (pseudo - kFirstPublicPseudoId)));
3799 } 3755 }
3800 3756
3801 inline bool ComputedStyle::HasPseudoElementStyle() const { 3757 inline bool ComputedStyle::HasPseudoElementStyle() const {
3802 return PseudoBitsInternal() & kElementPseudoIdMask; 3758 return PseudoBitsInternal() & kElementPseudoIdMask;
3803 } 3759 }
3804 3760
3805 } // namespace blink 3761 } // namespace blink
3806 3762
3807 #endif // ComputedStyle_h 3763 #endif // ComputedStyle_h
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698