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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/overflow/overflow-clamp-after-transform-related-content-size-change.html

Issue 2524333003: Clamp scroll offset after overflow reclacs that are not layout inducing (Closed)
Patch Set: Created 4 years 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/paint/PaintLayerScrollableArea.h » ('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 <style>
3 #scroller {
4 height: 100px;
5 width: 100px;
6 overflow: scroll;
7 background-color: red;
8 }
9
10 #content {
11 width: 100px;
12 height: 100px;
13 background: green;
14 }
15 </style>
16
17 <div id="scroller">
18 <div id="content"></div>
19 </div>
20
21 <script src="../../resources/testharness.js"></script>
22 <script src="../../resources/testharnessreport.js"></script>
23
24 <script>
25 test(t => {
26 var scroller = document.querySelector("#scroller");
27 var content = document.querySelector("#content");
28
29 content.style.transform = "translateX(400px)";
30 assert_equals(scroller.scrollWidth, 500);
31
32 scroller.scrollLeft = 300;
33 assert_equals(scroller.scrollLeft, 300);
34
35 // make a non-layout inducing change that updates the overflow
36 content.style.transform = "translateX(100px)";
37 assert_equals(scroller.scrollWidth, 200);
38 assert_equals(scroller.scrollLeft, 200 - scroller.clientWidth /* max scroll of fset */);
39 }, "Verify that scroll offset clamps correctly when overflow rect is changed " +
40 " as a result of a transform (i.e., a non-layout inducing change)");
41 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698