Status: FAIL | Duration: 15ms | Subtests: 0/1 | Open test on wpt.live | Open ref on wpt.live | wpt.fyi
/css/css-position/sticky/position-sticky-top-and-bottom-003.html
<!DOCTYPE html> <meta charset="UTF-8"> <title>CSS Position Test: sticky element with top and bottom offsets specified with percentage unit</title> <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> <link rel="help" href="https://www.w3.org/TR/css-position-3/#sticky-pos"> <link rel="match" href="reference/position-sticky-top-and-bottom-003-ref.html"> <meta name="flags" content=""> <style> div.scrolling-container { background-image: url("support/100x100-red.png"); background-repeat: no-repeat; display: inline-block; height: 250px; margin-right: 30px; overflow: auto; position: static; width: 150px; } div#first-scrolling-container { background-position: left 125px; } div#second-scrolling-container { background-position: left 50px; } div#third-scrolling-container { background-position: left 25px; } div.vertical-spacer { height: 200px; } div.sticky { background-color: green; bottom: 10%; height: 100px; position: sticky; top: 10%; width: 100px; } </style> <body onload="document.getElementById("first-scrolling-container").scrollTop = 50; document.getElementById("second-scrolling-container").scrollTop = 150; document.getElementById("third-scrolling-container").scrollTop = 250;"> <p>Test passes if there are 3 filled green squares and <strong>no red</strong>. <!-- first-scrolling-container: when reaching the first (top) sticking point --> <div id="first-scrolling-container" class="scrolling-container"> <!-- 150w x 250h viewport --> <div class="vertical-spacer"></div> <!-- 150w x 200h --> <div id="first-sticky" class="sticky"></div> <!-- 100w x 100h --> <div class="vertical-spacer"></div> <!-- 150w x 200h --> </div> <!-- second-scrolling-container: between both sticking points --> <div id="second-scrolling-container" class="scrolling-container"> <!-- 150w x 250h viewport --> <div class="vertical-spacer"></div> <!-- 150w x 200h --> <div id="second-sticky" class="sticky"></div> <!-- 100w x 100h --> <div class="vertical-spacer"></div> <!-- 150w x 200h --> </div> <!-- third-scrolling-container: when reaching the second (bottom) sticking point --> <div id="third-scrolling-container" class="scrolling-container"> <!-- 150w x 250h viewport --> <div class="vertical-spacer"></div> <!-- 150w x 200h --> <div id="third-sticky" class="sticky"></div> <!-- 100w x 100h --> <div class="vertical-spacer"></div> <!-- 150w x 200h --> </div>
/css/css-position/sticky/reference/position-sticky-top-and-bottom-003-ref.html
<!DOCTYPE html> <meta charset="UTF-8"> <title>CSS Reftest Reference</title> <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> <style> div.scrolling-container { display: inline-block; height: 250px; margin-right: 30px; overflow: auto; position: static; width: 150px; } div.vertical-spacer { height: 200px; } div.sticky { background-color: green; height: 100px; position: relative; width: 100px; } div#first-sticky { bottom: 25px; } div#second-sticky { top: 0px; } div#third-sticky { top: 75px; } </style> <body onload="document.getElementById("first-scrolling-container").scrollTop = 50; document.getElementById("second-scrolling-container").scrollTop = 150; document.getElementById("third-scrolling-container").scrollTop = 250;"> <p>Test passes if there are 3 filled green squares and <strong>no red</strong>. <div id="first-scrolling-container" class="scrolling-container"> <!-- 150w x 250h viewport --> <div class="vertical-spacer"></div> <!-- 100w x 200h --> <div id="first-sticky" class="sticky"></div> <!-- 100w x 100h --> <div class="vertical-spacer"></div> <!-- 100w x 200h --> </div> <div id="second-scrolling-container" class="scrolling-container"> <!-- 150w x 250h viewport --> <div class="vertical-spacer"></div> <!-- 100w x 200h --> <div id="second-sticky" class="sticky"></div> <!-- 100w x 100h --> <div class="vertical-spacer"></div> <!-- 100w x 200h --> </div> <div id="third-scrolling-container" class="scrolling-container"> <!-- 150w x 250h viewport --> <div class="vertical-spacer"></div> <!-- 100w x 200h --> <div id="third-sticky" class="sticky"></div> <!-- 100w x 100h --> <div class="vertical-spacer"></div> <!-- 100w x 200h --> </div>