Bug 1541691 [wpt PR 16151] - [css-properties-values-api] Absolutize initial <url> values., a=testonly
authorAnders Hartvoll Ruud <andruud@chromium.org>
Mon, 29 Apr 2019 12:04:38 +0000
changeset 531406 af86195c84cc019838d9c454f37e16401977adcf
parent 531405 ecf6b78ec6e70a12e3be3cb4dc9a45ad31144422
child 531407 e47e0b4546fb196fc1f787ffc060dfc524b2bce9
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1541691, 16151, 641877, 1528188, 646218
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1541691 [wpt PR 16151] - [css-properties-values-api] Absolutize initial <url> values., a=testonly Automatic update from web-platform-tests [css-properties-values-api] Absolutize initial <url> values. 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} -- wpt-commits: 2f2bf34086414fb3bd8e01e92aca1aa18e7ea730 wpt-pr: 16151
--- a/testing/web-platform/tests/css/css-properties-values-api/registered-property-initial.html
+++ b/testing/web-platform/tests/css/css-properties-values-api/registered-property-initial.html
@@ -25,16 +25,20 @@ test_initial_value({ syntax: '<length>',
 test_initial_value({ syntax: '<length>', initialValue: '72pt' }, '96px');
 test_initial_value({ syntax: '<percentage>', initialValue: 'calc(10% + 20%)' }, '30%');
 test_initial_value({ syntax: '<length-percentage>', initialValue: 'calc(1in + 10% + 4px)' }, 'calc(10% + 100px)');
 test_initial_value({ syntax: '<color>', initialValue: 'pink', inherits: true }, 'rgb(255, 192, 203)');
 test_initial_value({ syntax: '<color>', initialValue: 'purple' }, 'rgb(128, 0, 128)');
 test_initial_value({ syntax: '<transform-function>', initialValue: 'rotate(42deg)' }, 'rotate(42deg)');
 test_initial_value({ syntax: '<transform-list>', initialValue: 'scale(calc(2 + 2))' }, 'scale(4)');
 test_initial_value({ syntax: '<transform-list>', initialValue: 'scale(calc(2 + 1)) translateX(calc(3px + 1px))' }, 'scale(3) translateX(4px)');
+test_initial_value({ syntax: '<url>', initialValue: 'url(a)' },
+    `url("${new URL('a', document.baseURI)}")`);
+test_initial_value({ syntax: '<url>+', initialValue: 'url(a) url(a)' },
+    `url("${new URL('a', document.baseURI)}") url("${new URL('a', document.baseURI)}")`);
 // Test that the initial value of the custom property 'reg' is successfully
 // substituted into 'property'.
 function test_substituted_value(reg, property, expected) {
     let inherits_text = reg.inherits === true ? 'inherited' : 'non-inherited';
         try {
             let name = generate_property(reg);