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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/css/sticky/sticky-position-valid-after-insertion.html

Issue 2667003003: Revert of Force compositing inputs to be clean for getBoundingClientRect (Closed)
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/css/sticky/sticky-position-valid-after-layout.html » ('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 <style>
5 body {
6 margin: 0;
7 }
8
9 .scroller {
10 height: 100px;
11 width: 200px;
12 overflow: scroll;
13 }
14
15 .padding {
16 width: 400px;
17 height: 500px;
18 }
19
20 .sticky {
21 width: 25px;
22 height: 25px;
23 position: sticky;
24 top: 20px;
25 left: 50px;
26 }
27 </style>
28
29 <div class="scroller" id="scroller">
30 <div class="padding" id="padding"></div>
31 </div>
32
33 <div class="scroller" id="scroller2">
34 <div class="padding" id="padding2"></div>
35 </div>
36
37 <script>
38 if (window.internals) {
39 internals.settings.setCSSStickyPositionEnabled(true);
40 }
41
42 test(function() {
43 var scroller = document.getElementById('scroller');
44 scroller.scrollTop = 100;
45 scroller.scrollLeft = 50;
46
47 var sticky = document.createElement('div');
48 sticky.className = 'sticky';
49 scroller.insertBefore(sticky, document.getElementById('padding'));
50
51 assert_equals(sticky.offsetTop, scroller.scrollTop + 20);
52 assert_equals(sticky.offsetLeft, scroller.scrollLeft + 50);
53 }, "offsetTop/offsetLeft should be correct for sticky after insertion");
54
55 test(function() {
56 var scroller = document.getElementById('scroller2');
57 scroller.scrollTop = 100;
58 scroller.scrollLeft = 50;
59
60 var sticky = document.createElement('div');
61 sticky.className = 'sticky';
62 scroller.insertBefore(sticky, document.getElementById('padding2'));
63
64 assert_equals(sticky.getBoundingClientRect().top, 120);
65 assert_equals(sticky.getBoundingClientRect().left, 50);
66 }, "getBoundingClientRect should be correct for sticky after insertion");
67
68
69 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/css/sticky/sticky-position-valid-after-layout.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698