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:
Emilio Cobos Álvarez 2021-02-17 00:21:36 +00:00
parent 1b18b06186
commit b0d05d1a5d
4 changed files with 96 additions and 54 deletions

View file

@ -837,6 +837,7 @@ impl PropertyDeclarationBlock {
custom_properties.as_ref(),
QuirksMode::NoQuirks,
device,
&mut Default::default()
)
.to_css(dest)
},