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

Unified Diff: third_party/WebKit/LayoutTests/fast/css/sticky/sticky-top-auto-get-computedstyle.html

Issue 2870983002: Update return value of getComputedStyle for sticky elements (Closed)
Patch Set: nit Created 3 years, 7 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/sticky-top-auto-get-computedstyle.html
diff --git a/third_party/WebKit/LayoutTests/fast/css/sticky/sticky-top-auto-get-computedstyle.html b/third_party/WebKit/LayoutTests/fast/css/sticky/sticky-top-auto-get-computedstyle.html
new file mode 100644
index 0000000000000000000000000000000000000000..7a00ab4d2a5a8f0befe1563fed2da1eb2b684460
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/css/sticky/sticky-top-auto-get-computedstyle.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<style>
+.box {
+ position: sticky;
+}
+
+.without-top {
+ top: auto;
+}
+
+.with-top {
+ top: 0px;
+}
+
+.with-bottom {
+ bottom: 0px;
+}
+
+</style>
+
+<body>
flackr 2017/05/09 21:21:41 nit: I think the body tag is not usually included
yigu 2017/05/09 21:35:20 Done.
+ <div class="box without-top">Sticky, no top</div>
+ <div class="box with-top">Sticky, with top</div>
+ <div class="box with-bottom">Sticky, with bottom</div>
+</body>
+
+<!-- top should be auto when not specified for sticky elements. Same for the
+other attributes.-->
+<script>
+ if (window.testRunner)
+ testRunner.dumpAsText();
+
+ function doTest() {
+ var boxes = document.getElementsByClassName('box');
+ for (var i = 0; i < boxes.length; ++i) {
+ boxes[i].textContent += ': top = ' + getComputedStyle(boxes[i]).top;
+ boxes[i].textContent += '; bottom = ' + getComputedStyle(boxes[i]).bottom;
+ boxes[i].textContent += '; left = ' + getComputedStyle(boxes[i]).left;
+ boxes[i].textContent += '; right = ' + getComputedStyle(boxes[i]).right;
+ }
+ }
+
+ window.addEventListener('load', doTest, false);
+</script>

Powered by Google App Engine
This is Rietveld 408576698