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

Unified Diff: third_party/WebKit/LayoutTests/fast/loader/clamping-preserves-fragment-anchor.html

Issue 2474813002: Clamping shouldn't clear the fragment anchor. (Closed)
Patch Set: address review comments 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 | « no previous file | third_party/WebKit/LayoutTests/fast/loader/fragment-anchor-cleared-after-load.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/loader/clamping-preserves-fragment-anchor.html
diff --git a/third_party/WebKit/LayoutTests/fast/loader/clamping-preserves-fragment-anchor.html b/third_party/WebKit/LayoutTests/fast/loader/clamping-preserves-fragment-anchor.html
new file mode 100644
index 0000000000000000000000000000000000000000..765b16550e6769793d24626af4593dfc427ac0ab
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/loader/clamping-preserves-fragment-anchor.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<style>
+
+body { height: 1400px; }
+body.shrink { height: 1000px; }
+
+#anchor {
+ display: block;
+ position: absolute;
+ width: 100px;
+ height: 100px;
+ background-color: #fdd;
+ left: 200px;
+ top: 600px;
+}
+
+</style>
+<a id="anchor" name="foo"></a>
+<script>
+
+test(function(t) {
+ location.hash = "#foo";
+ assert_equals(scrollY, 600);
+ document.body.className = "shrink";
+ document.body.offsetHeight; // Force layout.
+ anchor.style.top = "200px";
+ assert_equals(scrollY, 200);
+}, "Preserve fragment anchor if clamping occurs during load.");
+
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/loader/fragment-anchor-cleared-after-load.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698