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

Unified Diff: third_party/WebKit/LayoutTests/external/wpt/css/css-position-3/position-sticky-nested-top.html

Issue 2734203003: Upstream first set of position:sticky tests to WPT (Closed)
Patch Set: Fix the indicators Created 3 years, 9 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 | third_party/WebKit/LayoutTests/external/wpt/css/css-position-3/position-sticky-nested-top-ref.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/external/wpt/css/css-position-3/position-sticky-nested-top.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-position-3/position-sticky-nested-top.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-position-3/position-sticky-nested-top.html
new file mode 100644
index 0000000000000000000000000000000000000000..b0b837257b8f494f73d5fbff9cbba168330d8edf
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-position-3/position-sticky-nested-top.html
@@ -0,0 +1,96 @@
+<!DOCTYPE html>
+<title>position:sticky elements should respect the top constraint when nested</title>
+<link rel="match" href="position-sticky-nested-top-ref.html" />
+<link rel="help" href="https://www.w3.org/TR/css-position-3/#sticky-pos" />
+<meta name="assert" content="This test checks that nested position:sticky elements obey their top anchor after scrolling" />
+
+<style>
+.group {
+ display: inline-block;
+ position: relative;
+ width: 150px;
+ height: 300px;
+}
+
+.scroller {
+ position: relative;
+ width: 100px;
+ height: 250px;
+ overflow: auto;
+}
+
+.contents {
+ height: 1000px;
+}
+
+.padding {
+ height: 200px;
+}
+
+.indicator {
+ background-color: red;
+ position: absolute;
+ width: 100px;
+ height: 100px;
+}
+
+.outerSticky {
+ background-color: green;
+ position: sticky;
+ width: 100px;
+ height: 100px;
+}
+
+.innerSticky {
+ background-color: fuchsia;
+ position: sticky;
+ width: 100px;
+ height: 50px;
+}
+</style>
+
+<script>
+window.addEventListener('load', function() {
+ for (const scroller of document.querySelectorAll('.scroller')) {
+ scroller.scrollTop = 250;
+ }
+});
+</script>
+
+<div class="group">
+ <div class="scroller">
+ <div class="indicator" style="top: 250px;"></div>
+ <div class="contents">
+ <div class="padding"></div>
+ <div class="outerSticky" style="top: 0;">
flackr 2017/03/17 18:27:36 We can have an inner indicator too right? To mark
smcgruer 2017/03/17 18:41:46 Oh, that's an excellent idea, fixed. I wasn't thin
+ <div class="innerSticky" style="top: 0;"></div>
+ </div>
+ </div>
+ </div>
+</div>
+
+<div class="group">
+ <div class="scroller">
+ <div class="indicator" style="top: 325px;"></div>
+ <div class="contents">
+ <div class="padding"></div>
+ <div class="outerSticky" style="top: 75px;">
+ <div class="innerSticky" style="top: 100px;"></div>
+ </div>
+ </div>
+ </div>
+</div>
+
+<div class="group">
+ <div class="scroller">
+ <div class="indicator" style="top: 375px;"></div>
+ <div class="contents">
+ <div class="padding"></div>
+ <div class="outerSticky" style="top: 125px;">
+ <div class="innerSticky" style="top: 250px;"></div>
+ </div>
+ </div>
+ </div>
+</div>
+
+<div>You should see three green and fuchsia boxes above. No red should be visible.</div>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/external/wpt/css/css-position-3/position-sticky-nested-top-ref.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698