Skip to content

Commit

Permalink
Fix rebase issues and run Prettier on layout viewer code
Browse files Browse the repository at this point in the history
  • Loading branch information
ferjm committed Feb 21, 2020
1 parent a042f85 commit c4276aa
Show file tree
Hide file tree
Showing 6 changed files with 394 additions and 345 deletions.
3 changes: 1 addition & 2 deletions components/layout_2020/flow/mod.rs
Expand Up @@ -9,8 +9,7 @@ use crate::flow::float::{FloatBox, FloatContext};
use crate::flow::inline::InlineFormattingContext;
use crate::formatting_contexts::{IndependentFormattingContext, IndependentLayout, NonReplacedIFC};
use crate::fragments::{AnonymousFragment, BoxFragment};
use crate::fragments::{CollapsedBlockMargins, CollapsedMargin};
use crate::fragments::{DebugId, Fragment};
use crate::fragments::{CollapsedBlockMargins, CollapsedMargin, Fragment};
use crate::geom::flow_relative::{Rect, Sides, Vec2};
use crate::positioned::{AbsolutelyPositionedBox, PositioningContext};
use crate::replaced::ReplacedContent;
Expand Down
2 changes: 1 addition & 1 deletion components/layout_2020/positioned.rs
Expand Up @@ -5,7 +5,7 @@
use crate::context::LayoutContext;
use crate::dom_traversal::{Contents, NodeExt};
use crate::formatting_contexts::IndependentFormattingContext;
use crate::fragments::{AnonymousFragment, BoxFragment, CollapsedBlockMargins, DebugId, Fragment};
use crate::fragments::{AnonymousFragment, BoxFragment, CollapsedBlockMargins, Fragment};
use crate::geom::flow_relative::{Rect, Sides, Vec2};
use crate::sizing::ContentSizesRequest;
use crate::style_ext::{ComputedValuesExt, DisplayInside};
Expand Down
4 changes: 2 additions & 2 deletions components/layout_2020/query.rs
Expand Up @@ -166,7 +166,7 @@ impl LayoutRPC for LayoutRPCImpl {

pub fn process_content_box_request(
requested_node: OpaqueNode,
fragment_tree_root: Option<&FragmentTreeRoot>,
fragment_tree_root: Option<Arc<FragmentTreeRoot>>,
) -> Option<Rect<Au>> {
let fragment_tree_root = match fragment_tree_root {
Some(fragment_tree_root) => fragment_tree_root,
Expand All @@ -182,7 +182,7 @@ pub fn process_content_boxes_request(_requested_node: OpaqueNode) -> Vec<Rect<Au

pub fn process_node_geometry_request(
requested_node: OpaqueNode,
fragment_tree_root: Option<&FragmentTreeRoot>,
fragment_tree_root: Option<Arc<FragmentTreeRoot>>,
) -> Rect<i32> {
let fragment_tree_root = match fragment_tree_root {
Some(fragment_tree_root) => fragment_tree_root,
Expand Down
2 changes: 1 addition & 1 deletion components/layout_2020/replaced.rs
Expand Up @@ -34,7 +34,7 @@ pub(crate) struct ReplacedContent {
///
/// * For SVG, see https://svgwg.org/svg2-draft/coords.html#SizingSVGInCSS
/// and again https://github.com/w3c/csswg-drafts/issues/4572.
#[derive(Debug)]
#[derive(Debug, Serialize)]
pub(crate) struct IntrinsicSizes {
pub width: Option<Length>,
pub height: Option<Length>,
Expand Down
12 changes: 5 additions & 7 deletions components/layout_thread_2020/lib.rs
Expand Up @@ -874,8 +874,8 @@ impl LayoutThread {
self.dump_style_tree,
self.dump_rule_tree,
self.relayout_event,
true, // nonincremental_layout
self.trace_layout, // trace_layout
true, // nonincremental_layout
self.trace_layout, // trace_layout
self.dump_flow_tree, // dump_flow_tree
);
}
Expand Down Expand Up @@ -1235,10 +1235,8 @@ impl LayoutThread {
match *reflow_goal {
ReflowGoal::LayoutQuery(ref querymsg, _) => match querymsg {
&QueryMsg::ContentBoxQuery(node) => {
rw_data.content_box_response = process_content_box_request(
node,
(&*self.fragment_tree_root.borrow()).as_ref(),
);
rw_data.content_box_response =
process_content_box_request(node, self.fragment_tree_root.borrow().clone());
},
&QueryMsg::ContentBoxesQuery(node) => {
rw_data.content_boxes_response = process_content_boxes_request(node);
Expand All @@ -1253,7 +1251,7 @@ impl LayoutThread {
&QueryMsg::ClientRectQuery(node) => {
rw_data.client_rect_response = process_node_geometry_request(
node,
(&*self.fragment_tree_root.borrow()).as_ref(),
self.fragment_tree_root.borrow().clone(),
);
},
&QueryMsg::NodeScrollGeometryQuery(node) => {
Expand Down

0 comments on commit c4276aa

Please sign in to comment.