Skip to content

Commit

Permalink
servo: Merge #18148 - style: pass a borrow instead of an Arc (from ta…
Browse files Browse the repository at this point in the history
…mird:computedvalues-arc-borrow); r=emilio

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.

- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors

Source-Repo: https://github.com/servo/servo
Source-Revision: c1b196b7cb7e5efd3cd4de0c9562dcca5da34564
  • Loading branch information
tamird committed Aug 19, 2017
1 parent 9c89681 commit 53968ea
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
3 changes: 1 addition & 2 deletions servo/components/style/gecko/restyle_damage.rs
Original file line number Diff line number Diff line change
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 servo/components/style/matching.rs
Original file line number Diff line number Diff line change
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 53968ea

Please sign in to comment.