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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <title>position:sticky elements should respect the top constraint when nested</t itle>
3 <link rel="match" href="position-sticky-nested-top-ref.html" />
4 <link rel="help" href="https://www.w3.org/TR/css-position-3/#sticky-pos" />
5 <meta name="assert" content="This test checks that nested position:sticky elemen ts obey their top anchor after scrolling" />
6
7 <style>
8 .group {
9 display: inline-block;
10 position: relative;
11 width: 150px;
12 height: 300px;
13 }
14
15 .scroller {
16 position: relative;
17 width: 100px;
18 height: 250px;
19 overflow: auto;
20 }
21
22 .contents {
23 height: 1000px;
24 }
25
26 .padding {
27 height: 200px;
28 }
29
30 .indicator {
31 background-color: red;
32 position: absolute;
33 width: 100px;
34 height: 100px;
35 }
36
37 .outerSticky {
38 background-color: green;
39 position: sticky;
40 width: 100px;
41 height: 100px;
42 }
43
44 .innerSticky {
45 background-color: fuchsia;
46 position: sticky;
47 width: 100px;
48 height: 50px;
49 }
50 </style>
51
52 <script>
53 window.addEventListener('load', function() {
54 for (const scroller of document.querySelectorAll('.scroller')) {
55 scroller.scrollTop = 250;
56 }
57 });
58 </script>
59
60 <div class="group">
61 <div class="scroller">
62 <div class="indicator" style="top: 250px;"></div>
63 <div class="contents">
64 <div class="padding"></div>
65 <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
66 <div class="innerSticky" style="top: 0;"></div>
67 </div>
68 </div>
69 </div>
70 </div>
71
72 <div class="group">
73 <div class="scroller">
74 <div class="indicator" style="top: 325px;"></div>
75 <div class="contents">
76 <div class="padding"></div>
77 <div class="outerSticky" style="top: 75px;">
78 <div class="innerSticky" style="top: 100px;"></div>
79 </div>
80 </div>
81 </div>
82 </div>
83
84 <div class="group">
85 <div class="scroller">
86 <div class="indicator" style="top: 375px;"></div>
87 <div class="contents">
88 <div class="padding"></div>
89 <div class="outerSticky" style="top: 125px;">
90 <div class="innerSticky" style="top: 250px;"></div>
91 </div>
92 </div>
93 </div>
94 </div>
95
96 <div>You should see three green and fuchsia boxes above. No red should be visibl e.</div>
OLDNEW
« 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