mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Return the result from process_content_box_request.
This commit is contained in:
parent
60e60b6f8a
commit
68830ed66f
2 changed files with 7 additions and 7 deletions
|
@ -1228,7 +1228,7 @@ impl LayoutTask {
|
|||
if let Some(mut root_flow) = rw_data.layout_root() {
|
||||
match data.query_type {
|
||||
ReflowQueryType::ContentBoxQuery(node) =>
|
||||
process_content_box_request(node, &mut root_flow, &mut rw_data),
|
||||
rw_data.content_box_response = process_content_box_request(node, &mut root_flow),
|
||||
ReflowQueryType::ContentBoxesQuery(node) =>
|
||||
rw_data.content_boxes_response = process_content_boxes_request(node, &mut root_flow),
|
||||
ReflowQueryType::NodeGeometryQuery(node) =>
|
||||
|
|
|
@ -10,7 +10,7 @@ use euclid::rect::Rect;
|
|||
use flow_ref::FlowRef;
|
||||
use fragment::{Fragment, FragmentBorderBoxIterator};
|
||||
use gfx::display_list::{DisplayItemMetadata, OpaqueNode};
|
||||
use layout_task::{LayoutTaskData, RWGuard};
|
||||
use layout_task::LayoutTaskData;
|
||||
use msg::constellation_msg::ConstellationChan;
|
||||
use msg::constellation_msg::Msg as ConstellationMsg;
|
||||
use opaque_node::OpaqueNodeMethods;
|
||||
|
@ -281,18 +281,18 @@ impl FragmentBorderBoxIterator for MarginRetrievingFragmentBorderBoxIterator {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn process_content_box_request<'a>(requested_node: TrustedNodeAddress,
|
||||
layout_root: &mut FlowRef,
|
||||
rw_data: &mut RWGuard<'a>) {
|
||||
pub fn process_content_box_request(requested_node: TrustedNodeAddress,
|
||||
layout_root: &mut FlowRef)
|
||||
-> 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 requested_node: OpaqueNode = OpaqueNodeMethods::from_script_node(requested_node);
|
||||
let mut iterator = UnioningFragmentBorderBoxIterator::new(requested_node);
|
||||
sequential::iterate_through_flow_tree_fragment_border_boxes(layout_root, &mut iterator);
|
||||
rw_data.content_box_response = match iterator.rect {
|
||||
match iterator.rect {
|
||||
Some(rect) => rect,
|
||||
None => Rect::zero()
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
pub fn process_content_boxes_request(requested_node: TrustedNodeAddress,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue