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

Unified Diff: third_party/WebKit/Source/core/layout/ng/ng_units.cc

Issue 2525033002: Deprecate NGPhysicalConstraintSpace (Closed)
Patch Set: update TestExpectations Created 4 years 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
Index: third_party/WebKit/Source/core/layout/ng/ng_units.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_units.cc b/third_party/WebKit/Source/core/layout/ng/ng_units.cc
index 2e515a8c53e60806a6cae10ef86e47ff8be4b791..b11d1ecc8057723a6c5e5b50260db6971ddb1735 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_units.cc
+++ b/third_party/WebKit/Source/core/layout/ng/ng_units.cc
@@ -226,4 +226,30 @@ bool NGMarginStrut::operator==(const NGMarginStrut& other) const {
negative_margin_block_start, negative_margin_block_end);
}
+NGExclusions::NGExclusions()
+ : last_left_float(nullptr), last_right_float(nullptr) {}
+
+NGExclusions::NGExclusions(const NGExclusions& other) {
+ for (const auto& exclusion : other.storage)
+ Add(*exclusion);
+}
+
+void NGExclusions::Add(const NGExclusion& exclusion) {
+ storage.append(makeUnique<NGExclusion>(exclusion));
+ if (exclusion.type == NGExclusion::kFloatLeft) {
+ last_left_float = storage.rbegin()->get();
+ } else if (exclusion.type == NGExclusion::kFloatRight) {
+ last_right_float = storage.rbegin()->get();
+ }
+}
+
+inline NGExclusions& NGExclusions::operator=(const NGExclusions& other) {
+ storage.clear();
+ last_left_float = nullptr;
+ last_right_float = nullptr;
+ for (const auto& exclusion : other.storage)
+ Add(*exclusion);
+ return *this;
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698