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

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

Issue 2365173002: Detach PaintLayerScrollableArea from RootFrameViewport when disposed. (Closed)
Patch Set: Fixed ASAN failure in previous patch Created 4 years, 3 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/paint/PaintLayerScrollableArea.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 101e7151c738d80d0dbeacfd613849624cfc397c..0ae0336731114da462a5a57ceaed6946c7d5a759 100644
--- a/third_party/WebKit/Source/web/tests/RootScrollerTest.cpp
+++ b/third_party/WebKit/Source/web/tests/RootScrollerTest.cpp
@@ -4,6 +4,7 @@
#include "core/frame/FrameHost.h"
#include "core/frame/FrameView.h"
+#include "core/frame/RootFrameViewport.h"
#include "core/frame/TopControls.h"
#include "core/html/HTMLFrameOwnerElement.h"
#include "core/layout/LayoutBox.h"
@@ -950,6 +951,42 @@ TEST_F(RootScrollerTest, RemoveClippingOnCompositorLayers)
}
}
+// Tests that removing the root scroller element from the DOM resets the
+// effective root scroller without waiting for any lifecycle events.
+TEST_F(RootScrollerTest, RemoveRootScrollerFromDom)
+{
+ initialize("root-scroller-iframe.html");
+
+ {
+ HTMLFrameOwnerElement* iframe = toHTMLFrameOwnerElement(
+ mainFrame()->document()->getElementById("iframe"));
+ Element* innerContainer =
+ iframe->contentDocument()->getElementById("container");
+
+ NonThrowableExceptionState exceptionState;
+ mainFrame()->document()->setRootScroller(iframe, exceptionState);
+ iframe->contentDocument()->setRootScroller(
+ innerContainer, exceptionState);
+ mainFrameView()->updateAllLifecyclePhases();
+
+ ASSERT_EQ(iframe, mainFrame()->document()->rootScroller());
+ ASSERT_EQ(iframe, effectiveRootScroller(mainFrame()->document()));
+ ASSERT_EQ(innerContainer, iframe->contentDocument()->rootScroller());
+ ASSERT_EQ(innerContainer,
+ effectiveRootScroller(iframe->contentDocument()));
+
+ iframe->contentDocument()->body()->setInnerHTML("", exceptionState);
+
+ // If the root scroller wasn't updated by the DOM removal above, this
+ // will touch the disposed root scroller's ScrollableArea.
+ mainFrameView()->getRootFrameViewport()->serviceScrollAnimations(0);
+
+ EXPECT_EQ(iframe->contentDocument()->documentElement(),
+ effectiveRootScroller(iframe->contentDocument()));
+ }
+}
+
+
} // namespace
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698