aboutsummaryrefslogtreecommitdiffstats
path: root/components/script_layout_interface
diff options
context:
space:
mode:
authorMartin Robinson <mrobinson@igalia.com>2023-09-15 12:57:54 +0200
committerGitHub <noreply@github.com>2023-09-15 10:57:54 +0000
commitabca586e0aa6111d9acd77d4976d52da7671214f (patch)
tree66d53361ec9c06246a5caf1ac5eec9ee35f8027c /components/script_layout_interface
parent0b86d6579823d0786b37cee86eaaf3ce6bd8aa7d (diff)
downloadservo-abca586e0aa6111d9acd77d4976d52da7671214f.tar.gz
servo-abca586e0aa6111d9acd77d4976d52da7671214f.zip
Refactor scrolls on the window object (#29680)
Refactor the scrolling and scrollable area calculation on the window object, to make it better match the specification. This has some mild changes to behavior, but in general things work the same as they did before. This is mainly preparation for properly handling viewport propagation of the `overflow` property but seems to fix a few issues as well. There is one new failure in Layout 2020 regarding `position: sticky`, but this isn't a big deal because there is no support for `position: sticky` in Layout 2020 yet. Co-authored-by: Rakhi Sharma <atbrakhi@igalia.com>
Diffstat (limited to 'components/script_layout_interface')
-rw-r--r--components/script_layout_interface/message.rs6
-rw-r--r--components/script_layout_interface/rpc.rs2
2 files changed, 4 insertions, 4 deletions
diff --git a/components/script_layout_interface/message.rs b/components/script_layout_interface/message.rs
index 5aeadef6894..01c5d58e659 100644
--- a/components/script_layout_interface/message.rs
+++ b/components/script_layout_interface/message.rs
@@ -101,7 +101,7 @@ pub enum QueryMsg {
ContentBoxQuery(OpaqueNode),
ContentBoxesQuery(OpaqueNode),
ClientRectQuery(OpaqueNode),
- NodeScrollGeometryQuery(OpaqueNode),
+ ScrollingAreaQuery(Option<OpaqueNode>),
OffsetParentQuery(OpaqueNode),
TextIndexQuery(OpaqueNode, Point2D<f32>),
NodesFromPointQuery(Point2D<f32>, NodesFromPointQueryType),
@@ -143,7 +143,7 @@ impl ReflowGoal {
QueryMsg::ContentBoxQuery(_) |
QueryMsg::ContentBoxesQuery(_) |
QueryMsg::ClientRectQuery(_) |
- QueryMsg::NodeScrollGeometryQuery(_) |
+ QueryMsg::ScrollingAreaQuery(_) |
QueryMsg::NodeScrollIdQuery(_) |
QueryMsg::ResolvedStyleQuery(..) |
QueryMsg::ResolvedFontStyleQuery(..) |
@@ -165,7 +165,7 @@ impl ReflowGoal {
QueryMsg::ContentBoxQuery(_) |
QueryMsg::ContentBoxesQuery(_) |
QueryMsg::ClientRectQuery(_) |
- QueryMsg::NodeScrollGeometryQuery(_) |
+ QueryMsg::ScrollingAreaQuery(_) |
QueryMsg::NodeScrollIdQuery(_) |
QueryMsg::ResolvedStyleQuery(..) |
QueryMsg::ResolvedFontStyleQuery(..) |
diff --git a/components/script_layout_interface/rpc.rs b/components/script_layout_interface/rpc.rs
index 232fecabe6b..3778d8f975a 100644
--- a/components/script_layout_interface/rpc.rs
+++ b/components/script_layout_interface/rpc.rs
@@ -27,7 +27,7 @@ pub trait LayoutRPC {
/// Requests the geometry of this node. Used by APIs such as `clientTop`.
fn node_geometry(&self) -> NodeGeometryResponse;
/// Requests the scroll geometry of this node. Used by APIs such as `scrollTop`.
- fn node_scroll_area(&self) -> NodeGeometryResponse;
+ fn scrolling_area(&self) -> NodeGeometryResponse;
/// Requests the scroll id of this node. Used by APIs such as `scrollTop`
fn node_scroll_id(&self) -> NodeScrollIdResponse;
/// Query layout for the resolved value of a given CSS property