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

Unified Diff: third_party/WebKit/Source/core/dom/LayoutTreeBuilderTraversalTest.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 | « third_party/WebKit/Source/core/dom/LayoutTreeBuilderTraversal.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/LayoutTreeBuilderTraversalTest.cpp
diff --git a/third_party/WebKit/Source/core/dom/LayoutTreeBuilderTraversalTest.cpp b/third_party/WebKit/Source/core/dom/LayoutTreeBuilderTraversalTest.cpp
index 5057167787d2ba3339901ef5fb2f6d8419db5ccd..ab151149256f6b275cbf58d4940a26687192401d 100644
--- a/third_party/WebKit/Source/core/dom/LayoutTreeBuilderTraversalTest.cpp
+++ b/third_party/WebKit/Source/core/dom/LayoutTreeBuilderTraversalTest.cpp
@@ -136,4 +136,24 @@ TEST_F(LayoutTreeBuilderTraversalTest, displayContentsChildrenNested) {
LayoutTreeBuilderTraversal::previousSiblingLayoutObject(*last));
}
+TEST_F(LayoutTreeBuilderTraversalTest, limits) {
+ const char* const html =
+ "<div></div>"
+ "<div style='display: contents'></div>"
+ "<div style='display: contents'>"
+ "<div style='display: contents'>"
+ "</div>"
+ "</div>"
+ "<div id='shouldNotBeFound'></div>";
+
+ setupSampleHTML(html);
+
+ Element* first = document().querySelector("div");
+
+ EXPECT_TRUE(first->layoutObject());
+ LayoutObject* nextSibling =
+ LayoutTreeBuilderTraversal::nextSiblingLayoutObject(*first, 2);
+ EXPECT_FALSE(nextSibling); // Should not overrecurse
+}
+
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/dom/LayoutTreeBuilderTraversal.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698