mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +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() {
|
if let Some(mut root_flow) = rw_data.layout_root() {
|
||||||
match data.query_type {
|
match data.query_type {
|
||||||
ReflowQueryType::ContentBoxQuery(node) =>
|
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) =>
|
ReflowQueryType::ContentBoxesQuery(node) =>
|
||||||
rw_data.content_boxes_response = process_content_boxes_request(node, &mut root_flow),
|
rw_data.content_boxes_response = process_content_boxes_request(node, &mut root_flow),
|
||||||
ReflowQueryType::NodeGeometryQuery(node) =>
|
ReflowQueryType::NodeGeometryQuery(node) =>
|
||||||
|
|
|
@ -10,7 +10,7 @@ use euclid::rect::Rect;
|
||||||
use flow_ref::FlowRef;
|
use flow_ref::FlowRef;
|
||||||
use fragment::{Fragment, FragmentBorderBoxIterator};
|
use fragment::{Fragment, FragmentBorderBoxIterator};
|
||||||
use gfx::display_list::{DisplayItemMetadata, OpaqueNode};
|
use gfx::display_list::{DisplayItemMetadata, OpaqueNode};
|
||||||
use layout_task::{LayoutTaskData, RWGuard};
|
use layout_task::LayoutTaskData;
|
||||||
use msg::constellation_msg::ConstellationChan;
|
use msg::constellation_msg::ConstellationChan;
|
||||||
use msg::constellation_msg::Msg as ConstellationMsg;
|
use msg::constellation_msg::Msg as ConstellationMsg;
|
||||||
use opaque_node::OpaqueNodeMethods;
|
use opaque_node::OpaqueNodeMethods;
|
||||||
|
@ -281,18 +281,18 @@ impl FragmentBorderBoxIterator for MarginRetrievingFragmentBorderBoxIterator {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn process_content_box_request<'a>(requested_node: TrustedNodeAddress,
|
pub fn process_content_box_request(requested_node: TrustedNodeAddress,
|
||||||
layout_root: &mut FlowRef,
|
layout_root: &mut FlowRef)
|
||||||
rw_data: &mut RWGuard<'a>) {
|
-> Rect<Au> {
|
||||||
// FIXME(pcwalton): This has not been updated to handle the stacking context relative
|
// FIXME(pcwalton): This has not been updated to handle the stacking context relative
|
||||||
// stuff. So the position is wrong in most cases.
|
// stuff. So the position is wrong in most cases.
|
||||||
let requested_node: OpaqueNode = OpaqueNodeMethods::from_script_node(requested_node);
|
let requested_node: OpaqueNode = OpaqueNodeMethods::from_script_node(requested_node);
|
||||||
let mut iterator = UnioningFragmentBorderBoxIterator::new(requested_node);
|
let mut iterator = UnioningFragmentBorderBoxIterator::new(requested_node);
|
||||||
sequential::iterate_through_flow_tree_fragment_border_boxes(layout_root, &mut iterator);
|
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,
|
Some(rect) => rect,
|
||||||
None => Rect::zero()
|
None => Rect::zero()
|
||||||
};
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn process_content_boxes_request(requested_node: TrustedNodeAddress,
|
pub fn process_content_boxes_request(requested_node: TrustedNodeAddress,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue