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

Unified Diff: LayoutTests/fast/css/sticky/sticky-top-overflow-scroll-by-fragment.html

Issue 186943003: Add layout test which checks sticky postioning when overflow is scrolled by fragment. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix indentation. Created 6 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 | « no previous file | LayoutTests/fast/css/sticky/sticky-top-overflow-scroll-by-fragment-expected.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/css/sticky/sticky-top-overflow-scroll-by-fragment.html
diff --git a/LayoutTests/fast/css/sticky/sticky-top-overflow.html b/LayoutTests/fast/css/sticky/sticky-top-overflow-scroll-by-fragment.html
similarity index 68%
copy from LayoutTests/fast/css/sticky/sticky-top-overflow.html
copy to LayoutTests/fast/css/sticky/sticky-top-overflow-scroll-by-fragment.html
index dfda8ae3db7452f59994493c3ebad433e3042c88..d0ca8929ab7f407d1690c8285c2aac13f6351868 100644
--- a/LayoutTests/fast/css/sticky/sticky-top-overflow.html
+++ b/LayoutTests/fast/css/sticky/sticky-top-overflow-scroll-by-fragment.html
@@ -1,6 +1,20 @@
<!DOCTYPE html>
<html>
<head>
+<script>
+ function done()
+ {
+ if (window.testRunner)
+ window.testRunner.notifyDone();
+ }
+
+ if (window.location.hash == '') {
+ if (window.testRunner)
+ window.testRunner.waitUntilDone();
+ window.onhashchange = done;
+ location = '#hash';
+ }
+</script>
<style>
.group {
display: inline-block;
@@ -14,12 +28,13 @@
height: 550px;
overflow: hidden; /* Still scrollable with JS */
border: 1px solid black;
+ position: relative;
}
.spacer {
float: left;
width: 10px;
- height: 1200px;
+ height: 500px;
}
.container {
width: 100px;
@@ -32,6 +47,14 @@
height: 200px;
}
+ .hash {
+ width: 600px;
+ height: 10px;
+ background-color: gray;
+ position: absolute;
+ border: 0px;
+ }
+
.sticky {
position: sticky;
top: 100px;
@@ -45,17 +68,8 @@
background-color: red;
}
</style>
-<script>
- function doTest()
- {
- document.getElementById('overflow').scrollTop = 120;
- }
- window.addEventListener('load', doTest, false);
-</script>
</head>
<body>
-This test checks that sticky positioned elements are contained by their enclosing ancestor with an overflow clip.
-There should be no red.
<div id="overflow">
<div class="spacer"></div>
<div class="group">
@@ -78,6 +92,13 @@ There should be no red.
<div class="sticky box"></div>
</div>
</div>
+ <div id="hash" class="hash" style="top: 119px;">
+ </div>
+ </div>
+ <div style="position: absolute; top: 560px;">
+ This test checks that sticky positioning when scrolled by fragment.
+ There should be no red.
</div>
</body>
</html>
+
« no previous file with comments | « no previous file | LayoutTests/fast/css/sticky/sticky-top-overflow-scroll-by-fragment-expected.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698