diff options
author | Martin Robinson <mrobinson@igalia.com> | 2023-04-25 08:29:09 +0200 |
---|---|---|
committer | Martin Robinson <mrobinson@igalia.com> | 2023-04-25 21:25:00 +0200 |
commit | 3ab5e2a188a2e6e892367dfbcd4880bd9aadeab8 (patch) | |
tree | 41e7c3af2ec5467bf2432fd03dca2e65c0c99ebf /components/script_layout_interface | |
parent | 2ae158dec19d735ee1ffc6a4e7aab495b0d96dc1 (diff) | |
download | servo-3ab5e2a188a2e6e892367dfbcd4880bd9aadeab8.tar.gz servo-3ab5e2a188a2e6e892367dfbcd4880bd9aadeab8.zip |
Scroll from script should trigger a reflow
Scrolling from script should flow layout and send a display list to
WebRender. This allows all of the scroll nodes to exist in WebRender
before asking it to move the node.
See https://gist.github.com/paulirish/5d52fb081b3570c81e3a.
Fixes #29659.
Diffstat (limited to 'components/script_layout_interface')
-rw-r--r-- | components/script_layout_interface/message.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/components/script_layout_interface/message.rs b/components/script_layout_interface/message.rs index 9e4312fd2d5..feeded5054c 100644 --- a/components/script_layout_interface/message.rs +++ b/components/script_layout_interface/message.rs @@ -81,10 +81,6 @@ pub enum Msg { /// Tells layout about the new scrolling offsets of each scrollable stacking context. SetScrollStates(Vec<ScrollState>), - /// Tells layout about a single new scrolling offset from the script. The rest will - /// remain untouched and layout won't forward this back to script. - UpdateScrollStateFromScript(ScrollState), - /// Tells layout that script has added some paint worklet modules. RegisterPaint(Atom, Vec<Atom>, Box<dyn Painter>), @@ -125,6 +121,10 @@ pub enum ReflowGoal { Full, TickAnimations, LayoutQuery(QueryMsg, u64), + + /// Tells layout about a single new scrolling offset from the script. The rest will + /// remain untouched and layout won't forward this back to script. + UpdateScrollNode(ScrollState), } impl ReflowGoal { @@ -132,7 +132,7 @@ impl ReflowGoal { /// be present or false if it only needs stacking-relative positions. pub fn needs_display_list(&self) -> bool { match *self { - ReflowGoal::Full | ReflowGoal::TickAnimations => true, + ReflowGoal::Full | ReflowGoal::TickAnimations | ReflowGoal::UpdateScrollNode(_) => true, ReflowGoal::LayoutQuery(ref querymsg, _) => match *querymsg { QueryMsg::NodesFromPointQuery(..) | QueryMsg::TextIndexQuery(..) | @@ -155,7 +155,7 @@ impl ReflowGoal { /// false if a layout_thread display list is sufficient. pub fn needs_display(&self) -> bool { match *self { - ReflowGoal::Full | ReflowGoal::TickAnimations => true, + ReflowGoal::Full | ReflowGoal::TickAnimations | ReflowGoal::UpdateScrollNode(_) => true, ReflowGoal::LayoutQuery(ref querymsg, _) => match *querymsg { QueryMsg::NodesFromPointQuery(..) | QueryMsg::TextIndexQuery(..) | |