Skip to content

Commit

Permalink
Bug 1298588 part 11. Pass through useful default styles to CascadePro…
Browse files Browse the repository at this point in the history
…pertyFn. r=bholley
  • Loading branch information
bzbarsky committed Jan 5, 2017
1 parent c826b18 commit 8367c96
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion components/style/properties/helpers.mako.rs
Expand Up @@ -210,6 +210,7 @@
#[allow(unused_variables)]
pub fn cascade_property(declaration: &PropertyDeclaration,
inherited_style: &ComputedValues,
default_style: &Arc<ComputedValues>,
context: &mut computed::Context,
seen: &mut PropertyBitField,
cacheable: &mut bool,
Expand Down Expand Up @@ -260,7 +261,7 @@
DeclaredValue::Initial => {
// We assume that it's faster to use copy_*_from rather than
// set_*(get_initial_value());
let initial_struct = ComputedValues::initial_values()
let initial_struct = default_style
.get_${data.current_style_struct.name_lower}();
context.mutate_style().mutate_${data.current_style_struct.name_lower}()
.copy_${property.ident}_from(initial_struct ${maybe_wm});
Expand Down
2 changes: 2 additions & 0 deletions components/style/properties/properties.mako.rs
Expand Up @@ -1668,6 +1668,7 @@ mod lazy_static_module {
pub type CascadePropertyFn =
extern "Rust" fn(declaration: &PropertyDeclaration,
inherited_style: &ComputedValues,
default_style: &Arc<ComputedValues>,
context: &mut computed::Context,
seen: &mut PropertyBitField,
cacheable: &mut bool,
Expand Down Expand Up @@ -1875,6 +1876,7 @@ pub fn apply_declarations<'a, F, I>(viewport_size: Size2D<Au>,
let discriminant = longhand_id as usize;
(CASCADE_PROPERTY[discriminant])(declaration,
inherited_style,
default_style,
&mut context,
&mut seen,
&mut cacheable,
Expand Down

0 comments on commit 8367c96

Please sign in to comment.