feat: Allow universal CSS values for all properties #410
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Support for the universal or "CSS-wide" property values (
initial
,inherit
, andunset
, see https://www.w3.org/TR/css-values/#common-keywords) is mixed at the moment.Several properties manually are defined to allow
initial
andinherit
, currently:Separately,
inherit
is allowed for every property, but only in thestyle
attribute, not in an extracted style block (the code that does this is only in the CSS AttrDef).This PR removes the special case in AttrDef_CSS and the explicit enum definitions in the CSSDefinition, and replaces both with checks in AttrDef_CSS and Filter_ExtractStyleBlocks against an enum of
initial
,inherit
, andunset
, making all three values allowed for all defined properties in both the attribute and block contexts.unset
, which hasn't previously been allowed here, is comparable toinitial
andinherit
: for properties that inherit by default, it acts asinherit
, for those that don't, it acts asinitial
.