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

Unified Diff: third_party/WebKit/Source/core/dom/LayoutTreeBuilderTraversal.cpp

Issue 2379483002: Use the sibling limit to decide whether to create layout for whitespace (Closed)
Patch Set: Bring patch to head. 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/dom/LayoutTreeBuilderTraversal.cpp
diff --git a/third_party/WebKit/Source/core/dom/LayoutTreeBuilderTraversal.cpp b/third_party/WebKit/Source/core/dom/LayoutTreeBuilderTraversal.cpp
index 578e0f874248b5c7c53f1575589d91fe3258466a..df6ce336cd67a569ae6ee9b3a8fafd813493c799 100644
--- a/third_party/WebKit/Source/core/dom/LayoutTreeBuilderTraversal.cpp
+++ b/third_party/WebKit/Source/core/dom/LayoutTreeBuilderTraversal.cpp
@@ -214,8 +214,10 @@ Node* next(const Node& node, const Node* stayWithin) {
return nextSkippingChildren(node, stayWithin);
}
-LayoutObject* nextSiblingLayoutObject(const Node& node) {
- for (Node* sibling = LayoutTreeBuilderTraversal::nextSibling(node); sibling;
+LayoutObject* nextSiblingLayoutObject(const Node& node, int32_t limit) {
+ DCHECK(limit == kTraverseAllSiblings || limit >= 0) << limit;
+ for (Node* sibling = LayoutTreeBuilderTraversal::nextSibling(node);
+ sibling && limit-- != 0;
sibling = LayoutTreeBuilderTraversal::nextSibling(*sibling)) {
LayoutObject* layoutObject = sibling->layoutObject();
if (layoutObject && !isLayoutObjectReparented(layoutObject))
@@ -224,9 +226,10 @@ LayoutObject* nextSiblingLayoutObject(const Node& node) {
return 0;
}
-LayoutObject* previousSiblingLayoutObject(const Node& node) {
+LayoutObject* previousSiblingLayoutObject(const Node& node, int32_t limit) {
+ DCHECK(limit == kTraverseAllSiblings || limit >= 0) << limit;
for (Node* sibling = LayoutTreeBuilderTraversal::previousSibling(node);
- sibling;
+ sibling && limit-- != 0;
sibling = LayoutTreeBuilderTraversal::previousSibling(*sibling)) {
LayoutObject* layoutObject = sibling->layoutObject();
if (layoutObject && !isLayoutObjectReparented(layoutObject))

Powered by Google App Engine
This is Rietveld 408576698