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

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: Update test with testharness.js 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp » ('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-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..3c2cf3525893165bc3241a3aacfc40c3a72e223b
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/css/sticky/sticky-top-auto-get-computedstyle.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+
+<style>
+#without_top {
+ top: auto;
+}
+
+#with_top {
+ top: 0px;
+}
+
+#with_bottom {
+ bottom: 0px;
+}
+
+.box {
+ position: sticky;
+}
+</style>
+
+<div class="box" id="without_top"></div>
+<div class="box" id="with_top"></div>
+<div class="box" id="with_bottom"></div>
+
+<script>
+test(() => {
+ var element = document.getElementById('without_top');
+ assert_equals(getComputedStyle(element).top, 'auto');
+}, 'top property should be auto if not specified.');
+
+test(() => {
+ var element = document.getElementById('with_top');
+ assert_equals(getComputedStyle(element).top, '0px');
+}, 'top property should be the actual value if specified.');
+
+test(() => {
+ var element = document.getElementById('with_bottom');
+ assert_equals(getComputedStyle(element).top, 'auto');
+}, 'top property should be auto if only bottom is specified.');
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698