diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2017-06-23 01:50:39 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-23 01:50:39 -0700 |
commit | 626c029623fea999fd7ea8650a6df8859ac87fcd (patch) | |
tree | c8519302def5cf477187465288897e32a925dc22 /components/script/dom/document.rs | |
parent | 7308997f09689f584078b603d166978af529d75d (diff) | |
parent | 284cb8aae8ed0c01c12aa866e8e7b15b07fcb816 (diff) | |
download | servo-626c029623fea999fd7ea8650a6df8859ac87fcd.tar.gz servo-626c029623fea999fd7ea8650a6df8859ac87fcd.zip |
Auto merge of #17385 - pyfisch:better-scroll, r=mrobinson
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.
Also try scrolling this [example page](https://pyfisch.org/stuff/scrolltest.html) in servo with and without this change.
<!-- Please describe your changes on the following line: -->
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #17342 (github issue number if applicable).
<!-- Either: -->
- [x] There are tests for these changes (partially)
<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->
<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17385)
<!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom/document.rs')
-rw-r--r-- | components/script/dom/document.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index d603d898f5c..c97d352872c 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -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), |