mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Fix several bugs related to scrolling
* scrollLeft/scrollTop returned values of parent or even document root Only the scroll of the node itself is returned. Otherwise 0.0. * Scrolling via script had set viewport. This resulted in other nodes appearing scrolled. Now scroll_offsets are updated with correct node id. These bugs caused other odd behavior like both body and document.documentElement being scrolled or the view for scrolled elements jumping.
This commit is contained in:
parent
b6667181ee
commit
6f62723898
2 changed files with 5 additions and 1 deletions
|
@ -574411,7 +574411,7 @@
|
||||||
"testharness"
|
"testharness"
|
||||||
],
|
],
|
||||||
"cssom-view/elementScroll.html": [
|
"cssom-view/elementScroll.html": [
|
||||||
"24c65428976fc4971a33368e6bf6f8b77199d69b",
|
"2119d689cc369bd6632ee1a9525bcbf7d1d4ba65",
|
||||||
"testharness"
|
"testharness"
|
||||||
],
|
],
|
||||||
"cssom-view/elementsFromPoint-iframes.html": [
|
"cssom-view/elementsFromPoint-iframes.html": [
|
||||||
|
|
|
@ -25,12 +25,14 @@
|
||||||
|
|
||||||
<section id="section">
|
<section id="section">
|
||||||
<div id="scrollable"></div>
|
<div id="scrollable"></div>
|
||||||
|
<div id="unrelated"></div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
setup({explicit_done:true});
|
setup({explicit_done:true});
|
||||||
window.onload = function () {
|
window.onload = function () {
|
||||||
var section = document.getElementById("section");
|
var section = document.getElementById("section");
|
||||||
|
var unrelated = document.getElementById("unrelated");
|
||||||
|
|
||||||
test(function () {
|
test(function () {
|
||||||
assert_equals(section.scrollTop, 0, "initial scrollTop should be 0");
|
assert_equals(section.scrollTop, 0, "initial scrollTop should be 0");
|
||||||
|
@ -41,6 +43,8 @@
|
||||||
|
|
||||||
assert_equals(section.scrollTop, 30, "changed scrollTop should be 40");
|
assert_equals(section.scrollTop, 30, "changed scrollTop should be 40");
|
||||||
assert_equals(section.scrollLeft, 40, "changed scrollLeft should be 40");
|
assert_equals(section.scrollLeft, 40, "changed scrollLeft should be 40");
|
||||||
|
assert_equals(unrelated.scrollTop, 0, "unrelated element should not scroll");
|
||||||
|
assert_equals(unrelated.scrollLeft, 0, "unrelated element should not scroll");
|
||||||
}, "Element scrollTop/Left getter/setter test");
|
}, "Element scrollTop/Left getter/setter test");
|
||||||
|
|
||||||
test(function () {
|
test(function () {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue