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

Side by Side Diff: third_party/WebKit/LayoutTests/external/wpt/css/css-position-3/position-sticky-left.html

Issue 2734203003: Upstream first set of position:sticky tests to WPT (Closed)
Patch Set: Make all tests in a suite the same html with different scroll position Created 3 years, 8 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
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <title>position:sticky elements should respect the left constraint</title>
3 <link rel="match" href="position-sticky-left-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 position:sticky elements obey their left anchor after scrolling" />
6
7 <style>
8 .group {
9 position: relative;
10 width: 250px;
11 height: 150px;
12 }
13
14 .scroller {
15 position: relative;
16 width: 200px;
17 height: 100px;
18 overflow-x: auto;
19 overflow-y: hidden;
20 }
21
22 .contents {
23 height: 100%;
24 width: 500px;
25 }
26
27 .prepadding {
28 display: inline-block;
29 height: 100%;
30 width: 100px;
31 }
32
33 .container {
34 display: inline-block;
35 height: 100%;
36 width: 200px;
37 }
38
39 .innerpadding {
40 display: inline-block;
41 height: 100%;
42 width: 50px;
43 }
44
45 .indicator {
46 background-color: red;
47 position: absolute;
48 top: 0;
49 }
50
51 .sticky {
52 background-color: green;
53 position: sticky;
54 left: 50px;
55 }
56
57 .box {
58 display: inline-block;
59 height: 100%;
60 width: 100px;
61 }
62
63 </style>
64
65 <script>
66 window.addEventListener('load', function() {
67 document.getElementById('scroller1').scrollLeft = 50;
68 document.getElementById('scroller2').scrollLeft = 125;
69 document.getElementById('scroller3').scrollLeft = 200;
70 });
71 </script>
72
73 <div class="group">
74 <div id="scroller1" class="scroller">
75 <div class="indicator box" style="left: 150px;"></div>
76 <div class="contents">
77 <!-- As these elements are inline, they are whitespace sensitive. -->
78 <div class="prepadding"></div><div class="container"><div class="innerpadd ing"></div><div class="sticky box"></div></div>
79 </div>
80 </div>
81 </div>
82
83 <div class="group">
84 <div id="scroller2" class="scroller">
85 <div class="indicator box" style="left: 175px;"></div>
86 <div class="contents">
87 <!-- As these elements are inline, they are whitespace sensitive. -->
88 <div class="prepadding"></div><div class="container"><div class="innerpadd ing"></div><div class="sticky box"></div></div>
89 </div>
90 </div>
91 </div>
92
93 <div class="group">
94 <div id="scroller3" class="scroller">
95 <div class="indicator box" style="left: 200px;"></div>
96 <div class="contents">
97 <!-- As these elements are inline, they are whitespace sensitive. -->
98 <div class="prepadding"></div><div class="container"><div class="innerpadd ing"></div><div class="sticky box"></div></div>
99 </div>
100 </div>
101 </div>
102
103 <div>You should see three green boxes above. No red should be visible.</div>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698