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

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: cache offset between layouts Created 4 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/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 d76d18c14eaaea59beab3c1af1448bd9a3267691..d431ffe89ab49711cadf9941c8a257d4c5468aa7 100644
--- a/third_party/WebKit/Source/core/layout/ScrollAnchorTest.cpp
+++ b/third_party/WebKit/Source/core/layout/ScrollAnchorTest.cpp
@@ -16,8 +16,16 @@ public:
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