| OLD | NEW |
| (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> |
| OLD | NEW |