Skip to content

Commit

Permalink
style: pass a borrow instead of an Arc
Browse files Browse the repository at this point in the history
https://bugzilla.mozilla.org/show_bug.cgi?id=1380133 has landed,
permitting us to pass a plain borrow into Gecko_CalcStyleDifference;
propagate this through style.

Closes #17795.
  • Loading branch information
tamird committed Aug 19, 2017
1 parent 9f64630 commit c348d5a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
3 changes: 1 addition & 2 deletions components/style/gecko/restyle_damage.rs
Expand Up @@ -9,7 +9,6 @@ use gecko_bindings::structs;
use gecko_bindings::structs::{nsChangeHint, nsStyleContext, nsStyleStructID};
use matching::{StyleChange, StyleDifference};
use properties::ComputedValues;
use servo_arc::Arc;
use std::ops::{BitAnd, BitOr, BitOrAssign, Not};

/// The representation of Gecko's restyle damage is just a wrapper over
Expand Down Expand Up @@ -49,7 +48,7 @@ impl GeckoRestyleDamage {
pub fn compute_style_difference(
source: &nsStyleContext,
old_style: &ComputedValues,
new_style: &Arc<ComputedValues>,
new_style: &ComputedValues,
) -> StyleDifference {
let mut any_style_changed: bool = false;
let hint = unsafe {
Expand Down
12 changes: 6 additions & 6 deletions components/style/matching.rs
Expand Up @@ -341,7 +341,7 @@ trait PrivateMatchMethods: TElement {
shared_context: &SharedStyleContext,
restyle: &mut RestyleData,
old_values: &ComputedValues,
new_values: &Arc<ComputedValues>,
new_values: &ComputedValues,
pseudo: Option<&PseudoElement>)
-> ChildCascadeRequirement {
// Don't accumulate damage if we're in a forgetful traversal.
Expand All @@ -360,7 +360,7 @@ trait PrivateMatchMethods: TElement {
restyle.reconstructed_self_or_ancestor();

let difference =
self.compute_style_difference(&old_values, &new_values, pseudo);
self.compute_style_difference(old_values, new_values, pseudo);

if !skip_applying_damage {
restyle.damage |= difference.damage;
Expand Down Expand Up @@ -389,10 +389,10 @@ trait PrivateMatchMethods: TElement {
_shared_context: &SharedStyleContext,
restyle: &mut RestyleData,
old_values: &ComputedValues,
new_values: &Arc<ComputedValues>,
new_values: &ComputedValues,
pseudo: Option<&PseudoElement>)
-> ChildCascadeRequirement {
let difference = self.compute_style_difference(&old_values, &new_values, pseudo);
let difference = self.compute_style_difference(old_values, new_values, pseudo);
restyle.damage |= difference.damage;
match difference.change {
StyleChange::Changed => ChildCascadeRequirement::MustCascadeChildren,
Expand Down Expand Up @@ -657,7 +657,7 @@ pub trait MatchMethods : TElement {
shared_context: &SharedStyleContext,
restyle: &mut RestyleData,
old_values: Option<&ComputedValues>,
new_values: &Arc<ComputedValues>,
new_values: &ComputedValues,
pseudo: Option<&PseudoElement>)
-> ChildCascadeRequirement {
let old_values = match old_values {
Expand Down Expand Up @@ -817,7 +817,7 @@ pub trait MatchMethods : TElement {
fn compute_style_difference(
&self,
old_values: &ComputedValues,
new_values: &Arc<ComputedValues>,
new_values: &ComputedValues,
pseudo: Option<&PseudoElement>
) -> StyleDifference {
debug_assert!(pseudo.map_or(true, |p| p.is_eager()));
Expand Down

0 comments on commit c348d5a

Please sign in to comment.