gecko-dev/layout
Frederic Wang 8638c84fb5 Bug 1840478 - Handle inherits flag and initial value for custom properties. r=emilio,zrhoffman
The CSS Properties and Values API allows to register CSS properties that
can be either inherited or non-inherited, and which can also have
initial values specified [1].

In [2], the representation of computed value for custom properties was
changed to a pair of CustomPropertiesMaps: one map which is ref-counted
(for properties unregistered or registered as inherited) and one which
is not (for properties registered as non-inherited). The latter map
is currently always None (i.e. all custom properties are handled as
inherited) and several parts of the code assume this condition holds.

This patch instead ensures that values for custom properties on a node
are properly placed in the inherit or non_inherit map according to the
inherits flag. Initial values for registered properties are taken
into account and missing implementations of functions assuming
non_inherited==None is completed.

In order to minimize the size of the maps, absent values for
non-inherited properties are interpreted as initial values during var
substitution or retrieval of computed values (for non-inherited
properties). This is used for `unset` and `initial` keywords while
a copy of the parent's value is used for `inherit`.

Last but not least, `CustomPropertiesBuilder` tries to perform lazy
copy of the inherited style, postponing actual deep clone when
necessary or falling back to a shallow copy when possible [3].
This is generalized a bit when the document contains custom properties
registered as non-inherited and current optimizations are preserved as
is for pages containing only non-registered custom properties. This
could be further improved later [4].

[1] https://drafts.css-houdini.org/css-properties-values-api-1/
[2] https://hg.mozilla.org/mozilla-central/rev/8a7d9524a1b9
[3] https://bugzilla.mozilla.org/show_bug.cgi?id=1840478
[4] https://bugzilla.mozilla.org/show_bug.cgi?id=1855887

Differential Revision: https://phabricator.services.mozilla.com/D188812
2023-09-29 09:00:46 +00:00
..
base Bug 1855134 - Move existing MOZ_TRY macros to a dedicated header file; r=glandium 2023-09-28 20:46:07 +00:00
build Bug 1853819 - Remove nsIU2FTokenManager. r=keeler 2023-09-20 05:02:36 +00:00
docs Bug 1847086 - Document that layout reftests have SpecialPowers access. r=botond 2023-08-15 00:20:54 +00:00
forms Bug 1855134 - Move existing MOZ_TRY macros to a dedicated header file; r=glandium 2023-09-28 20:46:07 +00:00
generic Bug 1855134 - Move existing MOZ_TRY macros to a dedicated header file; r=glandium 2023-09-28 20:46:07 +00:00
inspector Bug 1855134 - Move existing MOZ_TRY macros to a dedicated header file; r=glandium 2023-09-28 20:46:07 +00:00
ipc
mathml Bug 1850545 - convert .ini manifests to .toml: batch 3 chrome.ini (bis) r=jmaher,geckoview-reviewers,extension-reviewers,credential-management-reviewers,devtools-reviewers,fxview-reviewers,places-reviewers,profiler-reviewers,m_kato,mak,mtigley 2023-09-13 18:28:32 +00:00
media
painting Bug 1847900 - Rename TRANSPARENT constant to TRANSPARENT_BLACK. r=layout-reviewers,jfkthame 2023-09-28 10:36:12 +00:00
printing Bug 1855134 - Move existing MOZ_TRY macros to a dedicated header file; r=glandium 2023-09-28 20:46:07 +00:00
reftests Bug 1853867 - Remove -moz-image-rect(). r=tlouw 2023-09-26 07:15:02 +00:00
style Bug 1840478 - Handle inherits flag and initial value for custom properties. r=emilio,zrhoffman 2023-09-29 09:00:46 +00:00
svg Bug 1853323 - Remove browser.underline_anchors. r=settings-reviewers,mconley 2023-09-15 15:37:15 +00:00
tables Backed out changeset c20fe6f0a048 (bug 1825384) for causing table related reftest failures. CLOSED TREE 2023-09-11 19:51:30 +03:00
tools Bug 1855302 - Revert incorrect change to reftest-content which was causing intermittent failures. r=tnikkel 2023-09-27 07:28:06 +00:00
xul Bug 1855134 - Move existing MOZ_TRY macros to a dedicated header file; r=glandium 2023-09-28 20:46:07 +00:00
moz.build