[css-properties-values-api] Absolutize initial <url> values. #16151
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.
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}