From d276e9bc4c2e9c8dd981fde81692953e9fca36c0 Mon Sep 17 00:00:00 2001 From: Matt Brubeck Date: Wed, 6 Apr 2016 15:06:51 -0700 Subject: [PATCH 1/2] Remove an unnecessary Arc::clone --- components/layout/construct.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/layout/construct.rs b/components/layout/construct.rs index 6ee484e4c33..8ba85710ae3 100644 --- a/components/layout/construct.rs +++ b/components/layout/construct.rs @@ -973,7 +973,7 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode> block_flow)); let fragment = Fragment::from_opaque_node_and_style(node.opaque(), node.get_pseudo_element_type().strip(), - modified_style.clone(), + modified_style, node.selected_style().clone(), node.restyle_damage(), fragment_info); From f7139484a28b86a55798f615b92b39b43185235b Mon Sep 17 00:00:00 2001 From: Matt Brubeck Date: Mon, 4 Apr 2016 14:07:06 -0700 Subject: [PATCH 2/2] Avoid unnecessary make_mut in inline border drawing --- components/style/properties.mako.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/components/style/properties.mako.rs b/components/style/properties.mako.rs index fe9d654e592..a731f74bcc8 100644 --- a/components/style/properties.mako.rs +++ b/components/style/properties.mako.rs @@ -7010,6 +7010,18 @@ pub fn modify_border_style_for_inline_sides(style: &mut Arc is_first_fragment_of_element: bool, is_last_fragment_of_element: bool) { fn modify_side(style: &mut Arc, side: PhysicalSide) { + { + let border = &style.border; + let current_style = match side { + PhysicalSide::Left => (border.border_left_width, border.border_left_style), + PhysicalSide::Right => (border.border_right_width, border.border_right_style), + PhysicalSide::Top => (border.border_top_width, border.border_top_style), + PhysicalSide::Bottom => (border.border_bottom_width, border.border_bottom_style), + }; + if current_style == (Au(0), BorderStyle::none) { + return; + } + } let mut style = Arc::make_mut(style); let border = Arc::make_mut(&mut style.border); match side {