mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
layout: Expose whether the element was rendered in content_box_query to script.
But don't change the API yet.
This commit is contained in:
parent
8159dac506
commit
485fe874e8
5 changed files with 13 additions and 12 deletions
|
@ -54,7 +54,7 @@ pub struct LayoutThreadData {
|
|||
pub stylist: Arc<Stylist>,
|
||||
|
||||
/// A queued response for the union of the content boxes of a node.
|
||||
pub content_box_response: Rect<Au>,
|
||||
pub content_box_response: Option<Rect<Au>>,
|
||||
|
||||
/// A queued response for the content boxes of a node.
|
||||
pub content_boxes_response: Vec<Rect<Au>>,
|
||||
|
@ -384,15 +384,12 @@ impl FragmentBorderBoxIterator for MarginRetrievingFragmentBorderBoxIterator {
|
|||
}
|
||||
|
||||
pub fn process_content_box_request<N: LayoutNode>(
|
||||
requested_node: N, layout_root: &mut Flow) -> Rect<Au> {
|
||||
requested_node: N, layout_root: &mut Flow) -> Option<Rect<Au>> {
|
||||
// FIXME(pcwalton): This has not been updated to handle the stacking context relative
|
||||
// stuff. So the position is wrong in most cases.
|
||||
let mut iterator = UnioningFragmentBorderBoxIterator::new(requested_node.opaque());
|
||||
sequential::iterate_through_flow_tree_fragment_border_boxes(layout_root, &mut iterator);
|
||||
match iterator.rect {
|
||||
Some(rect) => rect,
|
||||
None => Rect::zero()
|
||||
}
|
||||
iterator.rect
|
||||
}
|
||||
|
||||
pub fn process_content_boxes_request<N: LayoutNode>(requested_node: N, layout_root: &mut Flow)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue