mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
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:
commit
35028f8f60
3 changed files with 7 additions and 7 deletions
|
@ -229,7 +229,7 @@
|
||||||
#[allow(unused_variables)]
|
#[allow(unused_variables)]
|
||||||
pub fn cascade_property(declaration: &PropertyDeclaration,
|
pub fn cascade_property(declaration: &PropertyDeclaration,
|
||||||
inherited_style: &ComputedValues,
|
inherited_style: &ComputedValues,
|
||||||
default_style: &Arc<ComputedValues>,
|
default_style: &ComputedValues,
|
||||||
context: &mut computed::Context,
|
context: &mut computed::Context,
|
||||||
cacheable: &mut bool,
|
cacheable: &mut bool,
|
||||||
cascade_info: &mut Option<<&mut CascadeInfo>,
|
cascade_info: &mut Option<<&mut CascadeInfo>,
|
||||||
|
|
|
@ -1760,7 +1760,7 @@ mod lazy_static_module {
|
||||||
pub type CascadePropertyFn =
|
pub type CascadePropertyFn =
|
||||||
extern "Rust" fn(declaration: &PropertyDeclaration,
|
extern "Rust" fn(declaration: &PropertyDeclaration,
|
||||||
inherited_style: &ComputedValues,
|
inherited_style: &ComputedValues,
|
||||||
default_style: &Arc<ComputedValues>,
|
default_style: &ComputedValues,
|
||||||
context: &mut computed::Context,
|
context: &mut computed::Context,
|
||||||
cacheable: &mut bool,
|
cacheable: &mut bool,
|
||||||
cascade_info: &mut Option<<&mut CascadeInfo>,
|
cascade_info: &mut Option<<&mut CascadeInfo>,
|
||||||
|
@ -1807,7 +1807,7 @@ pub fn cascade(viewport_size: Size2D<Au>,
|
||||||
rule_node: &StrongRuleNode,
|
rule_node: &StrongRuleNode,
|
||||||
parent_style: Option<<&ComputedValues>,
|
parent_style: Option<<&ComputedValues>,
|
||||||
layout_parent_style: Option<<&ComputedValues>,
|
layout_parent_style: Option<<&ComputedValues>,
|
||||||
default_style: &Arc<ComputedValues>,
|
default_style: &ComputedValues,
|
||||||
cascade_info: Option<<&mut CascadeInfo>,
|
cascade_info: Option<<&mut CascadeInfo>,
|
||||||
error_reporter: StdBox<ParseErrorReporter + Send>,
|
error_reporter: StdBox<ParseErrorReporter + Send>,
|
||||||
flags: CascadeFlags)
|
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());
|
debug_assert_eq!(parent_style.is_some(), layout_parent_style.is_some());
|
||||||
let (is_root_element, inherited_style, layout_parent_style) = match parent_style {
|
let (is_root_element, inherited_style, layout_parent_style) = match parent_style {
|
||||||
Some(parent_style) => (false, parent_style, layout_parent_style.unwrap()),
|
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.
|
// Hold locks until after the apply_declarations() call returns.
|
||||||
// Use filter_map because the root node has no style source.
|
// 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,
|
iter_declarations: F,
|
||||||
inherited_style: &ComputedValues,
|
inherited_style: &ComputedValues,
|
||||||
layout_parent_style: &ComputedValues,
|
layout_parent_style: &ComputedValues,
|
||||||
default_style: &Arc<ComputedValues>,
|
default_style: &ComputedValues,
|
||||||
mut cascade_info: Option<<&mut CascadeInfo>,
|
mut cascade_info: Option<<&mut CascadeInfo>,
|
||||||
mut error_reporter: StdBox<ParseErrorReporter + Send>,
|
mut error_reporter: StdBox<ParseErrorReporter + Send>,
|
||||||
font_metrics_provider: Option<<&FontMetricsProvider>,
|
font_metrics_provider: Option<<&FontMetricsProvider>,
|
||||||
|
|
|
@ -295,7 +295,7 @@ impl Stylist {
|
||||||
pub fn precomputed_values_for_pseudo(&self,
|
pub fn precomputed_values_for_pseudo(&self,
|
||||||
pseudo: &PseudoElement,
|
pseudo: &PseudoElement,
|
||||||
parent: Option<&Arc<ComputedValues>>,
|
parent: Option<&Arc<ComputedValues>>,
|
||||||
default: &Arc<ComputedValues>,
|
default: &ComputedValues,
|
||||||
cascade_flags: CascadeFlags)
|
cascade_flags: CascadeFlags)
|
||||||
-> ComputedStyle {
|
-> ComputedStyle {
|
||||||
debug_assert!(SelectorImpl::pseudo_element_cascade_type(pseudo).is_precomputed());
|
debug_assert!(SelectorImpl::pseudo_element_cascade_type(pseudo).is_precomputed());
|
||||||
|
@ -341,7 +341,7 @@ impl Stylist {
|
||||||
pub fn style_for_anonymous_box(&self,
|
pub fn style_for_anonymous_box(&self,
|
||||||
pseudo: &PseudoElement,
|
pseudo: &PseudoElement,
|
||||||
parent_style: &Arc<ComputedValues>,
|
parent_style: &Arc<ComputedValues>,
|
||||||
default_style: &Arc<ComputedValues>)
|
default_style: &ComputedValues)
|
||||||
-> Arc<ComputedValues> {
|
-> Arc<ComputedValues> {
|
||||||
// For most (but not all) pseudo-elements, we inherit all values from the parent.
|
// For most (but not all) pseudo-elements, we inherit all values from the parent.
|
||||||
let inherit_all = match *pseudo {
|
let inherit_all = match *pseudo {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue