Auto merge of #15930 - emilio:default-indirection, r=mbrubeck

style: Remove unneeded indirection in default_computed_values.

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15930)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-03-13 14:05:48 -07:00 committed by GitHub
commit 35028f8f60
3 changed files with 7 additions and 7 deletions

View file

@ -229,7 +229,7 @@
#[allow(unused_variables)]
pub fn cascade_property(declaration: &PropertyDeclaration,
inherited_style: &ComputedValues,
default_style: &Arc<ComputedValues>,
default_style: &ComputedValues,
context: &mut computed::Context,
cacheable: &mut bool,
cascade_info: &mut Option<<&mut CascadeInfo>,

View file

@ -1760,7 +1760,7 @@ mod lazy_static_module {
pub type CascadePropertyFn =
extern "Rust" fn(declaration: &PropertyDeclaration,
inherited_style: &ComputedValues,
default_style: &Arc<ComputedValues>,
default_style: &ComputedValues,
context: &mut computed::Context,
cacheable: &mut bool,
cascade_info: &mut Option<<&mut CascadeInfo>,
@ -1807,7 +1807,7 @@ pub fn cascade(viewport_size: Size2D<Au>,
rule_node: &StrongRuleNode,
parent_style: Option<<&ComputedValues>,
layout_parent_style: Option<<&ComputedValues>,
default_style: &Arc<ComputedValues>,
default_style: &ComputedValues,
cascade_info: Option<<&mut CascadeInfo>,
error_reporter: StdBox<ParseErrorReporter + Send>,
flags: CascadeFlags)
@ -1815,7 +1815,7 @@ pub fn cascade(viewport_size: Size2D<Au>,
debug_assert_eq!(parent_style.is_some(), layout_parent_style.is_some());
let (is_root_element, inherited_style, layout_parent_style) = match parent_style {
Some(parent_style) => (false, parent_style, layout_parent_style.unwrap()),
None => (true, &**default_style, &**default_style),
None => (true, &*default_style, &*default_style),
};
// Hold locks until after the apply_declarations() call returns.
// Use filter_map because the root node has no style source.
@ -1855,7 +1855,7 @@ pub fn apply_declarations<'a, F, I>(viewport_size: Size2D<Au>,
iter_declarations: F,
inherited_style: &ComputedValues,
layout_parent_style: &ComputedValues,
default_style: &Arc<ComputedValues>,
default_style: &ComputedValues,
mut cascade_info: Option<<&mut CascadeInfo>,
mut error_reporter: StdBox<ParseErrorReporter + Send>,
font_metrics_provider: Option<<&FontMetricsProvider>,

View file

@ -295,7 +295,7 @@ impl Stylist {
pub fn precomputed_values_for_pseudo(&self,
pseudo: &PseudoElement,
parent: Option<&Arc<ComputedValues>>,
default: &Arc<ComputedValues>,
default: &ComputedValues,
cascade_flags: CascadeFlags)
-> ComputedStyle {
debug_assert!(SelectorImpl::pseudo_element_cascade_type(pseudo).is_precomputed());
@ -341,7 +341,7 @@ impl Stylist {
pub fn style_for_anonymous_box(&self,
pseudo: &PseudoElement,
parent_style: &Arc<ComputedValues>,
default_style: &Arc<ComputedValues>)
default_style: &ComputedValues)
-> Arc<ComputedValues> {
// For most (but not all) pseudo-elements, we inherit all values from the parent.
let inherit_all = match *pseudo {