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

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: add test 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..64e8e239096db982c818abe4a1a08685589002d5
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/loader/clamping-preserves-fragment-anchor.html
@@ -0,0 +1,34 @@
+<!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;
+}
+
+body.shrink > #anchor {
+ top: 200px;
+}
+
+</style>
+<a id="anchor" name="foo"></a>
+<script>
+
+test(function(t) {
+ location.hash = "#foo";
+ assert_equals(scrollY, 600);
+ document.body.className = "shrink";
bokan 2016/11/03 11:19:12 This both shrinks the body and moves the <a>. Mayb
skobes 2016/11/03 13:31:42 Done.
+ 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