Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure roundtrip for parsing & serialization of custom properties and var() #27794

Open
wants to merge 1 commit into
base: master
from

Conversation

@chromium-wpt-export-bot
Copy link
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented Feb 26, 2021

When tokenizing a style sheet, currently all comment tokens are
discarded. This patch adds a flag is_after_comment_ to CSSParserToken
to indicate removed comment tokens, so that we can add them back
in serialization, so that parsing & serialization of custom properties
can round-trip for cases like '--foo: 1/**/px'.

Using this mechanism, when resolving consecutive var() functions, we can
also insert a comment between them, so that the resolved token
sequence can be serialized with an empty comment in between. In this way,
parsing & serialization of consecutive var() functions can round-trip
for cases like '--a: 1; --b: px; --foo: var(a)var(b)'.

Bug: 1180294
Change-Id: I96e5958f1479b052eba12aff31fc18a6265b08b4

Reviewed-on: https://chromium-review.googlesource.com/2708609
WPT-Export-Revision: 51af0c053b56b6cbd86045e2eef6d2a31cd4efab

… var()

When tokenizing a style sheet, currently all comment tokens are
discarded. This patch adds a flag is_after_comment_ to CSSParserToken
to indicate removed comment tokens, so that we can add them back
in serialization, so that parsing & serialization of custom properties
can round-trip for cases like '--foo: 1/**/px'.

Using this mechanism, when resolving consecutive var() functions, we can
also insert a comment between them, so that the resolved token
sequence can be serialized with an empty comment in between. In this way,
parsing & serialization of consecutive var() functions can round-trip
for cases like '--a: 1; --b: px; --foo: var(a)var(b)'.

Bug: 1180294
Change-Id: I96e5958f1479b052eba12aff31fc18a6265b08b4
Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

The review process for this patch is being conducted in the Chromium project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants