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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../../../resources/testharness.js"></script>
3 <script src="../../../resources/testharnessreport.js"></script>
4
5 <style>
6 #without_top {
7 top: auto;
8 }
9
10 #with_top {
11 top: 0px;
12 }
13
14 #with_bottom {
15 bottom: 0px;
16 }
17
18 .box {
19 position: sticky;
20 }
21 </style>
22
23 <div class="box" id="without_top"></div>
24 <div class="box" id="with_top"></div>
25 <div class="box" id="with_bottom"></div>
26
27 <script>
28 test(() => {
29 var element = document.getElementById('without_top');
30 assert_equals(getComputedStyle(element).top, 'auto');
31 }, 'top property should be auto if not specified.');
32
33 test(() => {
34 var element = document.getElementById('with_top');
35 assert_equals(getComputedStyle(element).top, '0px');
36 }, 'top property should be the actual value if specified.');
37
38 test(() => {
39 var element = document.getElementById('with_bottom');
40 assert_equals(getComputedStyle(element).top, 'auto');
41 }, 'top property should be auto if only bottom is specified.');
42 </script>
OLDNEW
« 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