Closed Bug 1842707 Opened 1 year ago Closed 1 year ago

[wpt-sync] Sync PR 40959 - [url] Add tests for trailing spaces on setters

Categories

(Core :: DOM: Networking, task, P4)

task

Tracking

()

RESOLVED FIXED
117 Branch
Tracking Status
firefox117 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 40959 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/40959
Details from upstream follow.

Luca Casonato <hello@lcas.dev> wrote:

[url] Add tests for trailing spaces on setters

Adding some tests around trailing spaces and C0 control characters for pathname,
search, and hash setters, because some implementations incorrectly strip them.

Simplified test case:

const url = new URL('http://example.com/');
url.pathname = '/ ';
url.search = '? ';
url.hash = '# ';
console.log(url.href);

Implementations:

// whatwg-url@13.0.0
"http://example.com/%20?%20#%20" ✅

// Chrome 117.0.5881.0
"http://example.com/%20?%20#%20" ✅

// Firefox 114.0.2
"http://example.com/%20?%20#%20" ✅

// Safari TP 171
"http://example.com/?#%20" ❌

// Deno 1.35.0
"http://example.com/?%20#%20" ❌

// node@20.4.0
"http://example.com/%20?%20#%20" ✅
Component: web-platform-tests → DOM: Networking
Product: Testing → Core
Test result changes from PR not available.
Test result changes from PR not available.
Test result changes from PR not available.
Test result changes from PR not available.
Test result changes from PR not available.
Test result changes from PR not available.
Pushed by wptsync@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/3d2dea4c3882
[wpt PR 40959] - [url] Add tests for trailing spaces on setters, a=testonly
https://hg.mozilla.org/integration/autoland/rev/8742a34eac1f
[wpt PR 40959] - Update wpt metadata, a=testonly
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 117 Branch
You need to log in before you can comment on or make changes to this bug.