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

Unified 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/style/ComputedStyle.h
diff --git a/third_party/WebKit/Source/core/style/ComputedStyle.h b/third_party/WebKit/Source/core/style/ComputedStyle.h
index 90342759e0e5d6ae4ceaf73ec095d9f5234f190e..ff5b21027c65aa8bbe3b14fcbc4b3b4264e75330 100644
--- a/third_party/WebKit/Source/core/style/ComputedStyle.h
+++ b/third_party/WebKit/Source/core/style/ComputedStyle.h
@@ -37,7 +37,6 @@
#include "core/style/LineClampValue.h"
#include "core/style/NinePieceImage.h"
#include "core/style/SVGComputedStyle.h"
-#include "core/style/StyleBoxData.h"
#include "core/style/StyleContentAlignmentData.h"
#include "core/style/StyleDeprecatedFlexibleBoxData.h"
#include "core/style/StyleDifference.h"
@@ -181,6 +180,58 @@ class CORE_EXPORT ComputedStyle : public ComputedStyleBase,
friend class StyleResolverState;
friend class StyleResolver;
+ private:
+ class StyleBoxData : public RefCountedCopyable<StyleBoxData> {
+ public:
+ static PassRefPtr<StyleBoxData> Create() {
+ return AdoptRef(new StyleBoxData);
+ }
+ PassRefPtr<StyleBoxData> Copy() const {
+ return AdoptRef(new StyleBoxData(*this));
+ }
+
+ bool operator==(const StyleBoxData& other) const {
+ return width_ == other.width_ && height_ == other.height_ &&
+ min_width_ == other.min_width_ && max_width_ == other.max_width_ &&
+ min_height_ == other.min_height_ &&
+ max_height_ == other.max_height_ &&
+ vertical_align_length_ == other.vertical_align_length_ &&
+ z_index_ == other.z_index_ &&
+ has_auto_z_index_ == other.has_auto_z_index_ &&
+ box_sizing_ == other.box_sizing_ &&
+ box_decoration_break_ == other.box_decoration_break_;
+ }
+ bool operator!=(const StyleBoxData& o) const { return !(*this == o); }
+
+ Length width_;
+ Length height_;
+ Length min_width_;
+ Length max_width_;
+ Length min_height_;
+ Length max_height_;
+ Length vertical_align_length_;
+ int z_index_;
+ unsigned has_auto_z_index_ : 1;
+ unsigned box_sizing_ : 1; // EBoxSizing
+ unsigned box_decoration_break_ : 1; // EBoxDecorationBreak
+
+ private:
+ StyleBoxData()
+ : width_(Length()),
+ height_(Length()),
+ min_width_(Length()),
+ max_width_(Length(kMaxSizeNone)),
+ min_height_(Length()),
+ max_height_(Length(kMaxSizeNone)),
+ z_index_(0),
+ has_auto_z_index_(static_cast<unsigned>(true)),
+ box_sizing_(static_cast<unsigned>(EBoxSizing::kContentBox)),
+ box_decoration_break_(
+ static_cast<unsigned>(EBoxDecorationBreak::kSlice)) {}
+
+ StyleBoxData(const StyleBoxData&) = default;
+ };
+
protected:
// non-inherited attributes
DataRef<StyleBoxData> box_data_;
« 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