summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-position.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-position.html')
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-position.html25
1 files changed, 25 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-position.html b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-position.html
new file mode 100644
index 0000000000..c38d2de83b
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-position.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="UTF-8">
+<title>Fragment Navigation: Scroll to block start position</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+<div id="test" style="position: absolute; top: 5px; left: 7px; margin: 5px 7px; border-style: solid; border-width: 5px 7px; padding: 5px 7px; height: 5px; width: 7px;"></div>
+<div style="height: 200vh;"></div>
+<script>
+async_test(function (t) {
+ on_event(window, 'load', function () {
+ t.step(function () {
+ window.scrollTo(0, 0);
+ location.hash = 'test';
+ assert_equals(window.scrollY, 10, 'Scroll to the top border edge of #test');
+ });
+ t.done();
+ });
+}, '');
+</script>
+</body>
+</html>