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

[css-properties-values-api] Absolutize initial <url> values. #16151

Merged
merged 1 commit into from Apr 1, 2019

Conversation

chromium-wpt-export-bot
Copy link
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented Mar 29, 2019

The computed value would incorrectly remain relative for the initial value
of <url>-registered custom properties. This is because it did not undergo
the token-rewriting done for non-initial properties.

Since the token-rewriting function was implemented, circumstances have
changed a little: there is now a general absolutization mechanism (i.e.
StyleBuilderConverter::ConvertRegisteredPropertyVariableData). Therefore,
this CL performs the URL absolutization on the CSSValue-level rather than
the token level. This automatically also catches the initial-value case.

Note that CSSVariableDatas with var()-references would previously "forget"
their base URL and TextEncoding when resolved. This didn't matter in
practice, because we would already have rewritten the tokens at that point.
However, it matters now, since the URL is now made absolute after the
CSSVariableData is resolved. Hence, CSSVariableData::CreateResolved has
gained the appropriate parameters.

R=futhark@chromium.org

Bug: 641877
Change-Id: I0fd80664adb49e60df24dcc0e91d23872f61fdb8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1528188
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Commit-Queue: Anders Hartvoll Ruud <andruud@chromium.org>
Cr-Commit-Position: refs/heads/master@{#646218}

Copy link
Collaborator

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already reviewed downstream.

The computed value would incorrectly remain relative for the initial value
of <url>-registered custom properties. This is because it did not undergo
the token-rewriting done for non-initial properties.

Since the token-rewriting function was implemented, circumstances have
changed a little: there is now a general absolutization mechanism (i.e.
StyleBuilderConverter::ConvertRegisteredPropertyVariableData). Therefore,
this CL performs the URL absolutization on the CSSValue-level rather than
the token level. This automatically also catches the initial-value case.

Note that CSSVariableDatas with var()-references would previously "forget"
their base URL and TextEncoding when resolved. This didn't matter in
practice, because we would already have rewritten the tokens at that point.
However, it matters now, since the URL is now made absolute _after_ the
CSSVariableData is resolved. Hence, CSSVariableData::CreateResolved has
gained the appropriate parameters.

R=futhark@chromium.org

Bug: 641877
Change-Id: I0fd80664adb49e60df24dcc0e91d23872f61fdb8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1528188
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Commit-Queue: Anders Hartvoll Ruud <andruud@chromium.org>
Cr-Commit-Position: refs/heads/master@{#646218}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants