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

Unified Diff: third_party/WebKit/Source/core/layout/ScrollAnchorTest.cpp

Issue 1640973005: Implement findAnchor and computeRelativeOffset in ScrollAnchor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@anchor-hookup
Patch Set: address review comment Created 4 years, 11 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/layout/ScrollAnchor.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/layout/ScrollAnchorTest.cpp
diff --git a/third_party/WebKit/Source/core/layout/ScrollAnchorTest.cpp b/third_party/WebKit/Source/core/layout/ScrollAnchorTest.cpp
index 26262fa8ab13ed3a4244d3cdb5119afce1e0a3d5..8faf1851b233a40f5cc8f2b3b0fd3269d64b0bec 100644
--- a/third_party/WebKit/Source/core/layout/ScrollAnchorTest.cpp
+++ b/third_party/WebKit/Source/core/layout/ScrollAnchorTest.cpp
@@ -19,8 +19,16 @@ class ScrollAnchorTest : public RenderingTest {
TEST_F(ScrollAnchorTest, Basic)
{
- ScrollAnchor scrollAnchor(document().view()->layoutViewportScrollableArea());
- scrollAnchor.clear();
- EXPECT_EQ(nullptr, scrollAnchor.anchorObject());
+ setBodyInnerHTML(
+ "<style> body { height: 1000px } div { height: 100px } </style>"
+ "<div id='block1'>abc</div>"
+ "<div id='block2'>def</div>");
+
+ ScrollableArea* viewport = document().view()->layoutViewportScrollableArea();
+ viewport->scrollBy(DoubleSize(0, 150), UserScroll);
+ document().getElementById("block1")->setAttribute(HTMLNames::styleAttr, "height: 200px");
+ document().view()->updateAllLifecyclePhases();
+ EXPECT_EQ(250, viewport->scrollPosition().y());
}
+
}
« no previous file with comments | « third_party/WebKit/Source/core/layout/ScrollAnchor.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698