mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
style: Cache substituted values from shorthand properties during the cascade.
This brings the time down to 1.6ms from 4.8ms on the test-case in the bug. This should be improvable too, but I think this is a nice improvement for regular styling as well. Differential Revision: https://phabricator.services.mozilla.com/D105187
This commit is contained in:
parent
1b18b06186
commit
b0d05d1a5d
4 changed files with 96 additions and 54 deletions
|
@ -367,6 +367,7 @@ impl AnimationValue {
|
|||
}
|
||||
},
|
||||
PropertyDeclaration::WithVariables(ref declaration) => {
|
||||
let mut cache = Default::default();
|
||||
let substituted = {
|
||||
let custom_properties =
|
||||
extra_custom_properties.or_else(|| context.style().custom_properties());
|
||||
|
@ -376,6 +377,7 @@ impl AnimationValue {
|
|||
custom_properties,
|
||||
context.quirks_mode,
|
||||
context.device(),
|
||||
&mut cache,
|
||||
)
|
||||
};
|
||||
return AnimationValue::from_declaration(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue