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

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

Issue 2451123003: Make NGLayoutOpportunityIterator to support origin_point. (Closed)
Patch Set: Created 4 years, 2 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
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 f63dd7bec69a42e67eeb916d1ad32135b0ca954c..5537f4b37d567414e58bb74a1b4396480b7bf67a 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_units.cc
+++ b/third_party/WebKit/Source/core/layout/ng/ng_units.cc
@@ -88,6 +88,18 @@ bool NGLogicalOffset::operator==(const NGLogicalOffset& other) const {
std::tie(inline_offset, block_offset);
}
+NGLogicalOffset NGLogicalOffset::operator+(const NGLogicalOffset& other) const {
+ NGLogicalOffset result;
+ result.inline_offset = this->inline_offset + other.inline_offset;
+ result.block_offset = this->block_offset + other.block_offset;
+ return result;
+}
+
+NGLogicalOffset& NGLogicalOffset::operator+=(const NGLogicalOffset& other) {
+ *this = *this + other;
+ return *this;
+}
+
bool NGBoxStrut::IsEmpty() const {
return *this == NGBoxStrut();
}

Powered by Google App Engine
This is Rietveld 408576698