mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Create proper root ClipId when scrolling from script
WebRender currently makes a distinction between an external ClipId with id equal to 0 and the root scroll ClipId. We need to detect this situation and properly form the ClipId for the root.
This commit is contained in:
parent
0a54d5a025
commit
6017dc0836
4 changed files with 59 additions and 1 deletions
|
@ -797,7 +797,12 @@ impl<Window: WindowMethods> IOCompositor<Window> {
|
|||
pipeline_id: PipelineId,
|
||||
scroll_root_id: ScrollRootId,
|
||||
point: Point2D<f32>) {
|
||||
let id = ClipId::new(scroll_root_id.0 as u64, pipeline_id.to_webrender());
|
||||
let id = if scroll_root_id.0 == 0 {
|
||||
ClipId::root_scroll_node(pipeline_id.to_webrender())
|
||||
} else {
|
||||
ClipId::new(scroll_root_id.0 as u64, pipeline_id.to_webrender())
|
||||
};
|
||||
|
||||
self.webrender_api.scroll_node_with_id(LayoutPoint::from_untyped(&point), id);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue