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:
Emilio Cobos Álvarez 2017-01-17 00:22:42 +01:00
parent 8159dac506
commit 485fe874e8
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
5 changed files with 13 additions and 12 deletions

View file

@ -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)