Skip to content

script: Use encoding_parse_a_url in Location assign - #44298

Merged
jdm merged 6 commits into
servo:mainfrom
TG199:Use_encoding_url_algorithm_in_location
May 28, 2026
Merged

jdm merged 6 commits into
servo:mainfrom
TG199:Use_encoding_url_algorithm_in_location

Conversation

@TG199

@TG199 TG199 commented Apr 17, 2026

Copy link
Copy Markdown
Contributor

Use "encoding-parse a URL" algorithm in Location
Testing: ./mach test-wpt tests/wpt/tests/html/browsers/history/the-location-interface
Fixes: #43506

@TG199
TG199 requested a review from gterzian as a code owner April 17, 2026 08:15
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Apr 17, 2026
Comment thread components/script/dom/location.rs Resolved
Comment thread components/script/dom/location.rs Resolved
@jdm

jdm commented Apr 17, 2026 •

Copy link
Copy Markdown
Member

It should be possible to write a test for this that:

  • Has a <meta charset=windows-1252>
  • Has an iframe with a same-origin src
  • Uses iframe.contentWindow.location.replace(iframe.contentWindow.location.href + "?test=\u00DF")
  • Waits for the iframe's onload event and verifies that the iframe's location's search property is ?test=%DF

@servo-wpt-sync

Copy link
Copy Markdown
Collaborator

🤖 Opened new upstream WPT pull request (web-platform-tests/wpt#60129) with upstreamable changes.

TG199 and others added 5 commits May 24, 2026 10:37
Co-authored-by: Josh Matthews <[email protected]>
Signed-off-by: TG199 <[email protected]>
Co-authored-by: Josh Matthews <[email protected]>
Signed-off-by: TG199 <[email protected]>
Signed-off-by: Kelechi Ebiri <[email protected]>
@TG199
TG199 force-pushed the Use_encoding_url_algorithm_in_location branch from 4f1a754 to f9eeb4d Compare May 24, 2026 09:47
@servo-wpt-sync

Copy link
Copy Markdown
Collaborator

📝 Transplanted new upstreamable changes to existing upstream WPT pull request (web-platform-tests/wpt#60129).

@jdm jdm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good, but we should keep the existing behaviour that matches the specification.

Comment thread components/script/dom/location.rs Outdated
// Step 2: Let url be the result of encoding-parsing a URL given the given value, relative to the entry settings object.
let base_url = self.entry_settings_object().api_base_url();
let url = match base_url.join(&value.0) {
let url = match self.window.Document().encoding_parse_a_url(&value.0) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We should keep using the entry settings object here.

Comment thread components/script/dom/location.rs Outdated
// Step 2. Let urlRecord be the result of encoding-parsing a URL given url, relative to the entry settings object.
let base_url = self.entry_settings_object().api_base_url();
let url = match base_url.join(&url.0) {
let url = match self.window.Document().encoding_parse_a_url(&url.0) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Here too.

@servo-highfive servo-highfive added S-needs-code-changes Changes have not yet been made that were requested by a reviewer. S-awaiting-review There is new code that needs to be reviewed. and removed S-awaiting-review There is new code that needs to be reviewed. S-needs-code-changes Changes have not yet been made that were requested by a reviewer. labels May 27, 2026
@servo-wpt-sync

Copy link
Copy Markdown
Collaborator

📝 Transplanted new upstreamable changes to existing upstream WPT pull request (web-platform-tests/wpt#60129).

@TG199
TG199 force-pushed the Use_encoding_url_algorithm_in_location branch from 5819f5e to 8729c8f Compare May 27, 2026 23:54
@servo-wpt-sync

Copy link
Copy Markdown
Collaborator

📝 Transplanted new upstreamable changes to existing upstream WPT pull request (web-platform-tests/wpt#60129).

@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label May 28, 2026
@jdm
jdm added this pull request to the merge queue May 28, 2026
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label May 28, 2026
Merged via the queue into servo:main with commit 6f7cc7f May 28, 2026
30 checks passed
@servo-highfive servo-highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label May 28, 2026
@servo-wpt-sync

Copy link
Copy Markdown
Collaborator

⛔ Failed to properly merge the upstream pull request (web-platform-tests/wpt#60129). Please address any CI issues and try to merge manually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use "encoding-parse a URL" algorithm in Location

4 participants