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

Unified Diff: third_party/WebKit/Source/web/tests/RootScrollerTest.cpp

Issue 2531343002: Don't assume current root scroller is a LayoutBox. (Closed)
Patch Set: Created 4 years, 1 month 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/page/scrolling/RootScrollerUtil.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/web/tests/RootScrollerTest.cpp
diff --git a/third_party/WebKit/Source/web/tests/RootScrollerTest.cpp b/third_party/WebKit/Source/web/tests/RootScrollerTest.cpp
index ae8b8d373a6abd6dd0422f4f1f9318fb52af32d0..ab8dfb0bfec8cf5bf86826f857f9b002db29c916 100644
--- a/third_party/WebKit/Source/web/tests/RootScrollerTest.cpp
+++ b/third_party/WebKit/Source/web/tests/RootScrollerTest.cpp
@@ -1168,6 +1168,25 @@ TEST_F(RootScrollerTest, RotationAnchoring) {
EXPECT_EQ(rect->top(), visualViewport().scrollOffset().height());
}
+// Tests that we don't crash if the default documentElement isn't a valid root
+// scroller. This can happen in some edge cases where documentElement isn't
+// <html>. crbug.com/668553.
+TEST_F(RootScrollerTest, InvalidDefaultRootScroller) {
+ initialize("overflow-scrolling.html");
+
+ Document* document = mainFrame()->document();
+
+ Element* br = document->createElement("br");
+ document->replaceChild(br, document->documentElement());
+ mainFrameView()->updateAllLifecyclePhases();
+ Element* html = document->createElement("html");
+ Element* body = document->createElement("body");
+ html->appendChild(body);
+ body->appendChild(br);
+ document->appendChild(html);
+ mainFrameView()->updateAllLifecyclePhases();
+}
+
} // namespace
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/page/scrolling/RootScrollerUtil.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698