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

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

Issue 2854333002: Move StyleBoxData.h to a nested class in ComputedStyle. (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, 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 19 matching lines...) Expand all
30 #include "core/CSSPropertyNames.h" 30 #include "core/CSSPropertyNames.h"
31 #include "core/ComputedStyleBase.h" 31 #include "core/ComputedStyleBase.h"
32 #include "core/CoreExport.h" 32 #include "core/CoreExport.h"
33 #include "core/style/BorderValue.h" 33 #include "core/style/BorderValue.h"
34 #include "core/style/ComputedStyleConstants.h" 34 #include "core/style/ComputedStyleConstants.h"
35 #include "core/style/CounterDirectives.h" 35 #include "core/style/CounterDirectives.h"
36 #include "core/style/DataRef.h" 36 #include "core/style/DataRef.h"
37 #include "core/style/LineClampValue.h" 37 #include "core/style/LineClampValue.h"
38 #include "core/style/NinePieceImage.h" 38 #include "core/style/NinePieceImage.h"
39 #include "core/style/SVGComputedStyle.h" 39 #include "core/style/SVGComputedStyle.h"
40 #include "core/style/StyleBoxData.h"
41 #include "core/style/StyleContentAlignmentData.h" 40 #include "core/style/StyleContentAlignmentData.h"
42 #include "core/style/StyleDeprecatedFlexibleBoxData.h" 41 #include "core/style/StyleDeprecatedFlexibleBoxData.h"
43 #include "core/style/StyleDifference.h" 42 #include "core/style/StyleDifference.h"
44 #include "core/style/StyleFilterData.h" 43 #include "core/style/StyleFilterData.h"
45 #include "core/style/StyleFlexibleBoxData.h" 44 #include "core/style/StyleFlexibleBoxData.h"
46 #include "core/style/StyleGridData.h" 45 #include "core/style/StyleGridData.h"
47 #include "core/style/StyleGridItemData.h" 46 #include "core/style/StyleGridItemData.h"
48 #include "core/style/StyleInheritedData.h" 47 #include "core/style/StyleInheritedData.h"
49 #include "core/style/StyleMultiColData.h" 48 #include "core/style/StyleMultiColData.h"
50 #include "core/style/StyleOffsetRotation.h" 49 #include "core/style/StyleOffsetRotation.h"
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 friend class ColorPropertyFunctions; 173 friend class ColorPropertyFunctions;
175 174
176 // FIXME: When we stop resolving currentColor at style time, these can be 175 // FIXME: When we stop resolving currentColor at style time, these can be
177 // removed. 176 // removed.
178 friend class CSSToStyleMap; 177 friend class CSSToStyleMap;
179 friend class FilterOperationResolver; 178 friend class FilterOperationResolver;
180 friend class StyleBuilderConverter; 179 friend class StyleBuilderConverter;
181 friend class StyleResolverState; 180 friend class StyleResolverState;
182 friend class StyleResolver; 181 friend class StyleResolver;
183 182
183 private:
184 class StyleBoxData : public RefCountedCopyable<StyleBoxData> {
185 public:
186 static PassRefPtr<StyleBoxData> Create() {
187 return AdoptRef(new StyleBoxData);
188 }
189 PassRefPtr<StyleBoxData> Copy() const {
190 return AdoptRef(new StyleBoxData(*this));
191 }
192
193 bool operator==(const StyleBoxData& other) const {
194 return width_ == other.width_ && height_ == other.height_ &&
195 min_width_ == other.min_width_ && max_width_ == other.max_width_ &&
196 min_height_ == other.min_height_ &&
197 max_height_ == other.max_height_ &&
198 vertical_align_length_ == other.vertical_align_length_ &&
199 z_index_ == other.z_index_ &&
200 has_auto_z_index_ == other.has_auto_z_index_ &&
201 box_sizing_ == other.box_sizing_ &&
202 box_decoration_break_ == other.box_decoration_break_;
203 }
204 bool operator!=(const StyleBoxData& o) const { return !(*this == o); }
205
206 Length width_;
207 Length height_;
208 Length min_width_;
209 Length max_width_;
210 Length min_height_;
211 Length max_height_;
212 Length vertical_align_length_;
213 int z_index_;
214 unsigned has_auto_z_index_ : 1;
215 unsigned box_sizing_ : 1; // EBoxSizing
216 unsigned box_decoration_break_ : 1; // EBoxDecorationBreak
217
218 private:
219 StyleBoxData()
220 : width_(Length()),
221 height_(Length()),
222 min_width_(Length()),
223 max_width_(Length(kMaxSizeNone)),
224 min_height_(Length()),
225 max_height_(Length(kMaxSizeNone)),
226 z_index_(0),
227 has_auto_z_index_(static_cast<unsigned>(true)),
228 box_sizing_(static_cast<unsigned>(EBoxSizing::kContentBox)),
229 box_decoration_break_(
230 static_cast<unsigned>(EBoxDecorationBreak::kSlice)) {}
231
232 StyleBoxData(const StyleBoxData&) = default;
233 };
234
184 protected: 235 protected:
185 // non-inherited attributes 236 // non-inherited attributes
186 DataRef<StyleBoxData> box_data_; 237 DataRef<StyleBoxData> box_data_;
187 DataRef<StyleVisualData> visual_data_; 238 DataRef<StyleVisualData> visual_data_;
188 DataRef<StyleRareNonInheritedData> rare_non_inherited_data_; 239 DataRef<StyleRareNonInheritedData> rare_non_inherited_data_;
189 240
190 // inherited attributes 241 // inherited attributes
191 DataRef<StyleRareInheritedData> rare_inherited_data_; 242 DataRef<StyleRareInheritedData> rare_inherited_data_;
192 DataRef<StyleInheritedData> inherited_data_; 243 DataRef<StyleInheritedData> inherited_data_;
193 244
(...skipping 3460 matching lines...) Expand 10 before | Expand all | Expand 10 after
3654 PseudoBitsInternal() | 1 << (pseudo - kFirstPublicPseudoId))); 3705 PseudoBitsInternal() | 1 << (pseudo - kFirstPublicPseudoId)));
3655 } 3706 }
3656 3707
3657 inline bool ComputedStyle::HasPseudoElementStyle() const { 3708 inline bool ComputedStyle::HasPseudoElementStyle() const {
3658 return PseudoBitsInternal() & kElementPseudoIdMask; 3709 return PseudoBitsInternal() & kElementPseudoIdMask;
3659 } 3710 }
3660 3711
3661 } // namespace blink 3712 } // namespace blink
3662 3713
3663 #endif // ComputedStyle_h 3714 #endif // ComputedStyle_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/style/BUILD.gn ('k') | third_party/WebKit/Source/core/style/StyleBoxData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698