aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2016-04-07 23:22:37 +0530
committerbors-servo <lbergstrom+bors@mozilla.com>2016-04-07 23:22:37 +0530
commit39ab006c8f71404d2fcd81f7715b7b9e47d5aead (patch)
tree8b4440c633d01af788012e63dec72ec2e0a3c1d0
parente66e437ae66346883cb2cc700f84d06c44962be1 (diff)
parentf7139484a28b86a55798f615b92b39b43185235b (diff)
downloadservo-39ab006c8f71404d2fcd81f7715b7b9e47d5aead.tar.gz
servo-39ab006c8f71404d2fcd81f7715b7b9e47d5aead.zip
Auto merge of #10402 - mbrubeck:make_mut, r=pcwalton
Avoid unnecessary Arc::clone and Arc::make_mut r? @pcwalton <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10402) <!-- Reviewable:end -->
-rw-r--r--components/layout/construct.rs2
-rw-r--r--components/style/properties.mako.rs12
2 files changed, 13 insertions, 1 deletions
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);
diff --git a/components/style/properties.mako.rs b/components/style/properties.mako.rs
index 7ba70b886ae..290e048afdd 100644
--- a/components/style/properties.mako.rs
+++ b/components/style/properties.mako.rs
@@ -7017,6 +7017,18 @@ pub fn modify_border_style_for_inline_sides(style: &mut Arc<ServoComputedValues>
is_first_fragment_of_element: bool,
is_last_fragment_of_element: bool) {
fn modify_side(style: &mut Arc<ServoComputedValues>, 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 {