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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/external/wpt/css/css-position-3/position-sticky-left.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-position-3/position-sticky-left.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-position-3/position-sticky-left.html
new file mode 100644
index 0000000000000000000000000000000000000000..40a4d7282dbe503ceb56c49c5133cca87b206e61
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-position-3/position-sticky-left.html
@@ -0,0 +1,103 @@
+<!DOCTYPE html>
+<title>position:sticky elements should respect the left constraint</title>
+<link rel="match" href="position-sticky-left-ref.html" />
+<link rel="help" href="https://www.w3.org/TR/css-position-3/#sticky-pos" />
+<meta name="assert" content="This test checks that position:sticky elements obey their left anchor after scrolling" />
+
+<style>
+.group {
+ position: relative;
+ width: 250px;
+ height: 150px;
+}
+
+.scroller {
+ position: relative;
+ width: 200px;
+ height: 100px;
+ overflow-x: auto;
+ overflow-y: hidden;
+}
+
+.contents {
+ height: 100%;
+ width: 500px;
+}
+
+.prepadding {
+ display: inline-block;
+ height: 100%;
+ width: 100px;
+}
+
+.container {
+ display: inline-block;
+ height: 100%;
+ width: 200px;
+}
+
+.innerpadding {
+ display: inline-block;
+ height: 100%;
+ width: 50px;
+}
+
+.indicator {
+ background-color: red;
+ position: absolute;
+ top: 0;
+}
+
+.sticky {
+ background-color: green;
+ position: sticky;
+ left: 50px;
+}
+
+.box {
+ display: inline-block;
+ height: 100%;
+ width: 100px;
+}
+
+</style>
+
+<script>
+window.addEventListener('load', function() {
+ document.getElementById('scroller1').scrollLeft = 50;
+ document.getElementById('scroller2').scrollLeft = 125;
+ document.getElementById('scroller3').scrollLeft = 200;
+});
+</script>
+
+<div class="group">
+ <div id="scroller1" class="scroller">
+ <div class="indicator box" style="left: 150px;"></div>
+ <div class="contents">
+ <!-- As these elements are inline, they are whitespace sensitive. -->
+ <div class="prepadding"></div><div class="container"><div class="innerpadding"></div><div class="sticky box"></div></div>
+ </div>
+ </div>
+</div>
+
+<div class="group">
+ <div id="scroller2" class="scroller">
+ <div class="indicator box" style="left: 175px;"></div>
+ <div class="contents">
+ <!-- As these elements are inline, they are whitespace sensitive. -->
+ <div class="prepadding"></div><div class="container"><div class="innerpadding"></div><div class="sticky box"></div></div>
+ </div>
+ </div>
+</div>
+
+<div class="group">
+ <div id="scroller3" class="scroller">
+ <div class="indicator box" style="left: 200px;"></div>
+ <div class="contents">
+ <!-- As these elements are inline, they are whitespace sensitive. -->
+ <div class="prepadding"></div><div class="container"><div class="innerpadding"></div><div class="sticky box"></div></div>
+ </div>
+ </div>
+</div>
+
+<div>You should see three green boxes above. No red should be visible.</div>

Powered by Google App Engine
This is Rietveld 408576698