Bug 1879743 - Rewrite custom property substitution to avoid re-tokenization. r=zrhoff...
commit9013524d23da6523a7ec4479b5682407a1323f6c
authorEmilio Cobos Álvarez <emilio@crisal.io>
Sun, 11 Feb 2024 15:23:22 +0000 (11 15:23 +0000)
committerEmilio Cobos Álvarez <emilio@crisal.io>
Sun, 11 Feb 2024 15:23:22 +0000 (11 15:23 +0000)
tree9f3a50cc5e176ac2c7eb3b0d3b8c87f8dcd3edfb
parent76c6cd45db86ba78eef2a813e6a372c075f5cf4b
Bug 1879743 - Rewrite custom property substitution to avoid re-tokenization. r=zrhoffman,firefox-style-system-reviewers

This speeds up custom variable substitution by avoiding re-tokenizing,
and variable reference parsing by avoiding doing duplicate work.

This is a very noticeable improvement in the NewsSite subtests of
speedometer 3 (see comparison posted in bug 1879318 and the #perf-sp3
matrix channel). But it also probably helps most websites using lots of
variables, and the browser UI itself.

Finally, it also avoids some duplication. Now regular substitution and
fallback substitution is handled uniformly, which causes a progression
in some properties-and-values tests.

Differential Revision: https://phabricator.services.mozilla.com/D201116
layout/style/test/test_variable_serialization_computed.html
servo/components/malloc_size_of/lib.rs
servo/components/style/custom_properties.rs
servo/components/style/properties_and_values/rule.rs
servo/components/style/properties_and_values/value.rs
servo/components/to_shmem/lib.rs
testing/web-platform/meta/css/css-properties-values-api/var-reference-registered-properties.html.ini