mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Properly handle scroll offsets in hit testing
Scroll roots are no longer nested containers holding items, so instead we need to track the offsets of each, carefully handling fixed position items and stacking contexts that create new reference frames. Additionally, we remove the complexity of the pre-computed page scroll offset, instead opting to send script scrolls to the layout task in order to more quickly have a ScrollState there that matches the script's idea of the scroll world. Fixes #16405.
This commit is contained in:
parent
7ca393a960
commit
9fd2df5c09
8 changed files with 221 additions and 178 deletions
|
@ -1955,12 +1955,8 @@ impl Document {
|
|||
}
|
||||
|
||||
pub fn nodes_from_point(&self, client_point: &Point2D<f32>) -> Vec<UntrustedNodeAddress> {
|
||||
let page_point =
|
||||
Point2D::new(client_point.x + self.window.PageXOffset() as f32,
|
||||
client_point.y + self.window.PageYOffset() as f32);
|
||||
|
||||
if !self.window.reflow(ReflowGoal::ForScriptQuery,
|
||||
ReflowQueryType::NodesFromPoint(page_point, *client_point),
|
||||
ReflowQueryType::NodesFromPoint(*client_point),
|
||||
ReflowReason::Query) {
|
||||
return vec!();
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue