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

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: 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..77c5ba34a6a0a4e39fe32e49fec1f4b7c789d52b
--- /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: 2px;
flackr 2017/05/09 20:26:34 nit: use top: 0px to showcase the original issue t
yigu 2017/05/09 20:43:58 Done.
+}
+
+.with-bottom {
+ bottom: 2px;
+}
+
+</style>
+
+<body>
+ <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