mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Bug 1298588 part 11. Pass through useful default styles to CascadePropertyFn. r=bholley
This commit is contained in:
parent
c826b18f87
commit
8367c96c1b
2 changed files with 4 additions and 1 deletions
|
@ -210,6 +210,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>,
|
||||||
context: &mut computed::Context,
|
context: &mut computed::Context,
|
||||||
seen: &mut PropertyBitField,
|
seen: &mut PropertyBitField,
|
||||||
cacheable: &mut bool,
|
cacheable: &mut bool,
|
||||||
|
@ -260,7 +261,7 @@
|
||||||
DeclaredValue::Initial => {
|
DeclaredValue::Initial => {
|
||||||
// We assume that it's faster to use copy_*_from rather than
|
// We assume that it's faster to use copy_*_from rather than
|
||||||
// set_*(get_initial_value());
|
// set_*(get_initial_value());
|
||||||
let initial_struct = ComputedValues::initial_values()
|
let initial_struct = default_style
|
||||||
.get_${data.current_style_struct.name_lower}();
|
.get_${data.current_style_struct.name_lower}();
|
||||||
context.mutate_style().mutate_${data.current_style_struct.name_lower}()
|
context.mutate_style().mutate_${data.current_style_struct.name_lower}()
|
||||||
.copy_${property.ident}_from(initial_struct ${maybe_wm});
|
.copy_${property.ident}_from(initial_struct ${maybe_wm});
|
||||||
|
|
|
@ -1668,6 +1668,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>,
|
||||||
context: &mut computed::Context,
|
context: &mut computed::Context,
|
||||||
seen: &mut PropertyBitField,
|
seen: &mut PropertyBitField,
|
||||||
cacheable: &mut bool,
|
cacheable: &mut bool,
|
||||||
|
@ -1875,6 +1876,7 @@ pub fn apply_declarations<'a, F, I>(viewport_size: Size2D<Au>,
|
||||||
let discriminant = longhand_id as usize;
|
let discriminant = longhand_id as usize;
|
||||||
(CASCADE_PROPERTY[discriminant])(declaration,
|
(CASCADE_PROPERTY[discriminant])(declaration,
|
||||||
inherited_style,
|
inherited_style,
|
||||||
|
default_style,
|
||||||
&mut context,
|
&mut context,
|
||||||
&mut seen,
|
&mut seen,
|
||||||
&mut cacheable,
|
&mut cacheable,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue