mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
script: Get scroll offsets from layout (#37509)
No longer store scroll offsets for elements in the DOM. Instead consistently get and set these in layout's `ScrollTree`. This more consistently requires layout to run when querying scroll offsets, which ensures that they are up-to-date and properly bounded by scrollable overflow area. Testing: This causes several WPT tests to start passing, and one to start failing. In the case of `/shadow-dom/scroll-to-the-fragment-in-shadow-tree.html`, I believe the issue is that we don't properly handle scrolling and shadow DOM elements. Before, the faulty scrolling was hiding this issue. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
518729a4f5
commit
3774ef00d4
14 changed files with 116 additions and 117 deletions
|
@ -18,7 +18,7 @@ use bitflags::bitflags;
|
|||
use devtools_traits::NodeInfo;
|
||||
use dom_struct::dom_struct;
|
||||
use embedder_traits::UntrustedNodeAddress;
|
||||
use euclid::default::{Rect, Size2D, Vector2D};
|
||||
use euclid::default::{Rect, Size2D};
|
||||
use html5ever::serialize::HtmlSerializer;
|
||||
use html5ever::{Namespace, Prefix, QualName, ns, serialize as html_serialize};
|
||||
use js::jsapi::JSObject;
|
||||
|
@ -980,12 +980,6 @@ impl Node {
|
|||
window.scrolling_area_query(Some(self), can_gc)
|
||||
}
|
||||
|
||||
pub(crate) fn scroll_offset(&self) -> Vector2D<f32> {
|
||||
let document = self.owner_doc();
|
||||
let window = document.window();
|
||||
window.scroll_offset_query(self).to_untyped()
|
||||
}
|
||||
|
||||
/// <https://dom.spec.whatwg.org/#dom-childnode-before>
|
||||
pub(crate) fn before(&self, nodes: Vec<NodeOrString>, can_gc: CanGc) -> ErrorResult {
|
||||
// Step 1.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue