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

Unified Diff: third_party/WebKit/LayoutTests/fast/css/sticky/nested/sticky-nested-left.html

Issue 2636253002: Handle nested position:sticky elements (Closed)
Patch Set: Rebase Created 3 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
Index: third_party/WebKit/LayoutTests/fast/css/sticky/nested/sticky-nested-left.html
diff --git a/third_party/WebKit/LayoutTests/fast/css/sticky/nested/sticky-nested-left.html b/third_party/WebKit/LayoutTests/fast/css/sticky/nested/sticky-nested-left.html
new file mode 100644
index 0000000000000000000000000000000000000000..04b23c08773a7e6d786be538f3af364595db8f13
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/css/sticky/nested/sticky-nested-left.html
@@ -0,0 +1,107 @@
+<!DOCTYPE html>
+<script>
+if (window.internals) {
+ internals.settings.setCSSStickyPositionEnabled(true);
+}
+</script>
+
+<html>
+<head>
+<style>
+ body {
+ margin: 0;
+ }
+
+ .group {
+ position: relative;
+ width: 350px;
+ height: 200px;
+ }
+
+ .scroller {
+ overflow: hidden; /* hide scrollbars */
+ width: 350px;
+ height: 180px;
+ outline: 2px solid black;
+ }
+
+ .container {
+ width: 700px;
+ height: 180px;
+ }
+
+ .outerSticky {
+ display: inline-block;
+ position: sticky;
+ background-color: green;
+ width: 200px;
+ height: 180px;
+ }
+
+ .innerSticky {
+ display: inline-block;
+ position: sticky;
+ background-color: red;
+ width: 100px;
+ height: 180px;
+ }
+</style>
+<script>
+if (window.testRunner)
+ testRunner.waitUntilDone();
+
+function doTest() {
+ finishTestInXFrames(2);
+}
+
+function finishTestInXFrames(frames) {
+ if (frames > 0) {
+ requestAnimationFrame(finishTestInXFrames.bind(null, frames - 1));
+ return;
+ }
+ finishTest();
+}
+
+function finishTest() {
+ for (const scroller of document.querySelectorAll('.scroller')) {
+ scroller.scrollLeft = 200;
+ }
+ if (window.testRunner)
+ testRunner.notifyDone();
+}
+
+window.addEventListener('load', doTest, false);
+</script>
+</head>
+<body>
+ <div class="group">
+ <div class="scroller">
+ <div class="container">
+ <div class="outerSticky" style="left: 50px;">
+ <div class="innerSticky" style="left: 50px;"></div>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <div class="group">
+ <div class="scroller">
+ <div class="container">
+ <div class="outerSticky" style="left: 50px;">
+ <div class="innerSticky" style="left: 100px;"></div>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <div class="group">
+ <div class="scroller">
+ <div class="container">
+ <div class="outerSticky" style="left: 50px;">
+ <div class="innerSticky" style="left: 300px;"></div>
+ </div>
+ </div>
+ </div>
+ </div>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698