| <!DOCTYPE html> |
| <style> |
| #grid { |
| display: grid; |
| height: 300px; |
| } |
| #item { |
| overflow: scroll; |
| overflow-anchor: none; |
| } |
| #content { |
| height: 800px; |
| } |
| </style> |
| <script src="../../resources/testharness.js"></script> |
| <script src="../../resources/testharnessreport.js"></script> |
| |
| <div id="log"></div> |
| |
| <div id="grid"> |
| <div id="item"> |
| <div id="content">AAA</div> |
| </div> |
| </div> |
| |
| <script> |
| onload = () => { |
| var item = document.querySelector("#item"); |
| item.scrollTo(0, 200); |
| document.querySelector("#content").innerHTML = "BBB"; |
| test(() => { |
| assert_equals(item.scrollTop, 200); |
| }, "Checks that scroll position is kept when grid item content is modified."); |
| }; |
| </script> |
| |