Index: LayoutTests/fast/css/sticky/sticky-grid.html |
diff --git a/LayoutTests/fast/css/sticky/sticky-grid.html b/LayoutTests/fast/css/sticky/sticky-grid.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..aecaf12041634f7ae48e12a90dd7a330f41465da |
--- /dev/null |
+++ b/LayoutTests/fast/css/sticky/sticky-grid.html |
@@ -0,0 +1,92 @@ |
+<!DOCTYPE html> |
+ |
+<html> |
+<head> |
+<style> |
+ body { |
+ margin: 0; |
+ width: 2000px; |
+ overflow: hidden; /* hide scrollbars */ |
+ } |
+ |
+ p { |
+ position: relative; |
+ left: 100px; |
+ } |
+ |
+ .group { |
+ position: relative; |
+ width: 500px; |
+ height: 200px; |
+ } |
+ |
+ .grid-container { |
+ display: grid; |
+ grid-template-columns: 50% 50%; |
+ grid-template-rows: 100%; |
+ width: 200px; |
+ height: 180px; |
+ outline: 2px solid black; |
+ } |
+ |
+ .box { |
+ width: 100px; |
+ height: 180px; |
+ } |
+ |
+ .grid-item { |
+ width: 100%; |
+ height: 100%; |
+ } |
+ |
+ .sticky { |
+ position: sticky; |
+ left: 100px; |
+ background-color: green; |
+ } |
+ |
+ .indicator { |
+ position: absolute; |
+ top: 0; |
+ left: 0; |
+ background-color: red; |
+ } |
+</style> |
+<script> |
+ function doTest() |
+ { |
+ window.scrollTo(100, 0); |
+ } |
+ window.addEventListener('load', doTest, false); |
+</script> |
+</head> |
+<body> |
+ <p>This test checks the behavior of position:sticky with grid items. |
+ There should be no red.</p> |
+ |
+ <div class="group" style="left: 100px"> |
+ <div class="indicator box" style="left: 100px;"></div> |
+ <div class="grid-container"> |
+ <div class="sticky grid-item" style="grid-column: 1; grid-row: 1;"></div> |
+ <div class="grid-item" style="grid-column: 2; grid-row: 1;"></div> |
+ </div> |
+ </div> |
+ |
+ <div class="group" style="left: 150px"> |
+ <div class="indicator box" style="left: 50px;"></div> |
+ <div class="grid-container" style="left: 100px"> |
+ <div class="sticky grid-item" style="grid-column: 1; grid-row: 1;"></div> |
+ <div class="grid-item" style="grid-column: 2; grid-row: 1;"></div> |
+ </div> |
+ </div> |
+ |
+ <div class="group" style="left: 200px"> |
+ <div class="indicator box" style="left: 0px;"></div> |
+ <div class="grid-container" style="left: 100px"> |
+ <div class="sticky grid-item" style="grid-column: 1; grid-row: 1;"></div> |
+ <div class="grid-item" style="grid-column: 2; grid-row: 1;"></div> |
+ </div> |
+ </div> |
+ |
+</body> |
+</html> |