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

Unified Diff: third_party/WebKit/Source/core/layout/ng/ng_exclusion.h

Issue 2733133002: Combine 2 exclusions in Layout Opportunity Tree if they shadow each other (Closed)
Patch Set: delete unreachable return statement Created 3 years, 9 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_exclusion.h
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_exclusion.h b/third_party/WebKit/Source/core/layout/ng/ng_exclusion.h
index b8b86edde75939f6e59a6008cc6d6c14c3e75cfa..b5a19ef8d4132da08f85c2fb45a5e22c0f47cac8 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_exclusion.h
+++ b/third_party/WebKit/Source/core/layout/ng/ng_exclusion.h
@@ -31,7 +31,25 @@ struct CORE_EXPORT NGExclusion {
Type type;
bool operator==(const NGExclusion& other) const;
+
String ToString() const;
+
+ // Tries to combine the current exclusion with {@code other} exclusion and
+ // returns true if successful.
+ // We can combine 2 exclusions if they
+ // - adjoining to each other and have the same exclusion type
+ // - {@code other} exclusion shadows the current one.
+ // That's because it's not allowed to position anything in the shadowed
+ // area.
+ //
+ // Example:
+ // <div id="SS" style="float: left; height: 10px; width: 10px"></div>
+ // <div id="BB" style="float: left; height: 20px; width: 20px"></div>
+ // +----------------+
+ // |SSBB
+ // |**BB
+ // We combine SS and BB exclusions including the shadowed area (**).
+ bool MaybeCombineWith(const NGExclusion& other);
};
CORE_EXPORT std::ostream& operator<<(std::ostream&, const NGExclusion&);

Powered by Google App Engine
This is Rietveld 408576698