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:
Pyfisch 2017-06-17 15:33:34 +02:00
parent effd6f2f87
commit 284cb8aae8
6 changed files with 33 additions and 25 deletions

View file

@ -703,6 +703,7 @@ impl Document {
// Step 3
let global_scope = self.window.upcast::<GlobalScope>();
let webrender_pipeline_id = global_scope.pipeline_id().to_webrender();
self.window.update_viewport_for_scroll(x, y);
self.window.perform_a_scroll(x,
y,
ClipId::root_scroll_node(webrender_pipeline_id),