-
Notifications
You must be signed in to change notification settings - Fork 756
Closed
Labels
Closed Accepted by CSSWG ResolutionCommenter SatisfiedCommenter has indicated satisfaction with the resolution / edits.Commenter has indicated satisfaction with the resolution / edits.Needs Testcase (WPT)css-variables-1Current WorkCurrent Work
Milestone
Description
The CSSWG previously resolved that custom properties must preserve their input exactly for serialization. I've been working on implementing that behavior in Blink, and @andruud brought up some cases in code review that seem worth clarifying:
- When serializing the computed value of a custom property, is the original text preserved? What about a custom property that has had another custom property substituted into it? Based on the use cases in the discussion, I'd think the answer would be "yes," and this is also what Gecko does.
--y: /* baz */;
--x: /* foo */ var(--y) /* bar */;
- When serializing a specified value containing a
var()reference. is the original text preserved? I think the use case of "transport non-CSS text in a custom property" is less compelling here, but Gecko preserves in this case as well.
color: /* bah */ var(--x);
- What about registered custom properties? In the case below, I'd expect that the computed value of
--zwould be/* should preserve */assuming no other rules apply, but I'm not sure whether that would extend to registered custom properties with more restrictive syntaxes:
@property --z {
syntax: "*";
inherits: true;
initial-value: /* should preserve */;
}
Test page for all of these cases: https://jsbin.com/dabegoq/4/edit?html,output
Metadata
Metadata
Assignees
Labels
Closed Accepted by CSSWG ResolutionCommenter SatisfiedCommenter has indicated satisfaction with the resolution / edits.Commenter has indicated satisfaction with the resolution / edits.Needs Testcase (WPT)css-variables-1Current WorkCurrent Work