mirror of
https://github.com/servo/servo.git
synced 2025-09-23 21:30:09 +01:00
Answer content box queries for layout_2020 for the root element
This isn't correct yet, but it is necessary to give a value in order for scrolling from script to work. Later this should give an accurate content box response as well as work for non-root elements.
This commit is contained in:
parent
27e0400891
commit
1cd772fe5f
3 changed files with 58 additions and 8 deletions
|
@ -5,6 +5,7 @@
|
|||
//! Utilities for querying the layout, as needed by the layout thread.
|
||||
|
||||
use crate::context::LayoutContext;
|
||||
use crate::flow::FragmentTreeRoot;
|
||||
use app_units::Au;
|
||||
use euclid::default::{Point2D, Rect};
|
||||
use euclid::Size2D;
|
||||
|
@ -163,8 +164,15 @@ impl LayoutRPC for LayoutRPCImpl {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn process_content_box_request(_requested_node: OpaqueNode) -> Option<Rect<Au>> {
|
||||
None
|
||||
pub fn process_content_box_request(
|
||||
_requested_node: OpaqueNode,
|
||||
fragment_tree_root: Option<&FragmentTreeRoot>,
|
||||
) -> Option<Rect<Au>> {
|
||||
let fragment_tree_root = match fragment_tree_root {
|
||||
Some(fragment_tree_root) => fragment_tree_root,
|
||||
None => return None,
|
||||
};
|
||||
Some(fragment_tree_root.bounding_box_of_border_boxes())
|
||||
}
|
||||
|
||||
pub fn process_content_boxes_request(_requested_node: OpaqueNode) -> Vec<Rect<Au>> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue