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

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

Issue 2715353002: Fix LayoutTreeBuilderTraversal limit checks when recursing. (Closed)
Patch Set: Created 3 years, 10 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 | « no previous file | third_party/WebKit/Source/core/dom/LayoutTreeBuilderTraversalTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 a9a0a1965dee92ade95f1b764876bf2e9a11a4b6..a502a25952b6965290486d37a9b59ef866ced8bc 100644
--- a/third_party/WebKit/Source/core/dom/LayoutTreeBuilderTraversal.cpp
+++ b/third_party/WebKit/Source/core/dom/LayoutTreeBuilderTraversal.cpp
@@ -250,7 +250,7 @@ static LayoutObject* nextSiblingLayoutObjectInternal(Node* node,
pseudoAwareFirstChild(*sibling), limit);
if (layoutObject)
return layoutObject;
- if (!limit)
+ if (limit == -1)
return nullptr;
}
@@ -270,7 +270,7 @@ LayoutObject* LayoutTreeBuilderTraversal::nextSiblingLayoutObject(
return sibling;
Node* parent = LayoutTreeBuilderTraversal::parent(node);
- while (limit && parent && hasDisplayContentsStyle(*parent)) {
+ while (limit != -1 && parent && hasDisplayContentsStyle(*parent)) {
if (LayoutObject* sibling =
nextSiblingLayoutObjectInternal(nextSibling(*parent), limit))
return sibling;
@@ -296,7 +296,7 @@ static LayoutObject* previousSiblingLayoutObjectInternal(Node* node,
pseudoAwareLastChild(*sibling), limit);
if (layoutObject)
return layoutObject;
- if (!limit)
+ if (limit == -1)
return nullptr;
}
@@ -316,7 +316,7 @@ LayoutObject* LayoutTreeBuilderTraversal::previousSiblingLayoutObject(
return sibling;
Node* parent = LayoutTreeBuilderTraversal::parent(node);
- while (limit && parent && hasDisplayContentsStyle(*parent)) {
+ while (limit != -1 && parent && hasDisplayContentsStyle(*parent)) {
if (LayoutObject* sibling = previousSiblingLayoutObjectInternal(
previousSibling(*parent), limit))
return sibling;
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/LayoutTreeBuilderTraversalTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698