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

Unified Diff: third_party/WebKit/LayoutTests/fast/css/sticky/sticky-style-change.html

Issue 2706673002: Mark elements as viewport constrained when they become sticky positioned (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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/css/sticky/sticky-style-change-expected.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/css/sticky/sticky-style-change.html
diff --git a/third_party/WebKit/LayoutTests/fast/css/sticky/sticky-style-change.html b/third_party/WebKit/LayoutTests/fast/css/sticky/sticky-style-change.html
new file mode 100644
index 0000000000000000000000000000000000000000..0524b75640d064fce9b25500da00b407dffabd65
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/css/sticky/sticky-style-change.html
@@ -0,0 +1,69 @@
+<!DOCTYPE html>
+<script>
+if (window.internals) {
+ internals.settings.setCSSStickyPositionEnabled(true);
+}
+</script>
+
+<html>
+<head>
+<style>
+ html {
+ overflow: hidden; /* hide scrollbars */
+ }
+
+ body {
+ margin: 0;
+ }
+
+ .container {
+ height: 2000px;
+ }
+
+ .box {
+ height: 50px;
+ }
+
+ .sticky {
+ position: sticky;
+ top: 50px;
+ background-color: green;
+ }
+</style>
+<script>
+ if (window.testRunner)
+ testRunner.waitUntilDone()
+
+ function doTest()
+ {
+ const sticky = document.querySelector('.sticky');
+ sticky.style.position = 'relative';
+
+ // Force layout.
+ sticky.offsetTop;
+
+ sticky.style.position = 'sticky';
+
+ window.requestAnimationFrame(function() {
+ window.scrollTo(0, 100);
+ if (window.testRunner)
+ testRunner.notifyDone();
+ });
+ }
+
+ window.addEventListener('load', function() {
+ // We require the compositings inputs to be clean (and thus the initial
+ // sticky position to be calculated) before we stat changing things.
+ // Force this by waiting for a double rAF.
+ window.requestAnimationFrame(function() {
+ window.requestAnimationFrame(doTest);
+ });
+ });
+</script>
+</head>
+<body>
+ <div class="container">
+ <div class="sticky box"></div>
+ </div>
+</body>
+</html>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/css/sticky/sticky-style-change-expected.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698