Skip to content

Use "encoding-parse a URL" algorithm in Location #43506

Closed

Description

@jdm

https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-location-assign step 3

// Step 3: Parse url relative to the entry settings object. If that failed,
// throw a "SyntaxError" DOMException.
let base_url = self.entry_settings_object().api_base_url();
let url = match base_url.join(&url.0) {

https://html.spec.whatwg.org/multipage/#dom-location-replace step 2

// 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) {

https://html.spec.whatwg.org/multipage/#dom-location-href step 2

// 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) {

This code was written before the specification was changed to use the new algorithm, so we can replace these join calls with

/// <https://html.spec.whatwg.org/multipage/#encoding-parsing-a-url>
pub(crate) fn encoding_parse_a_url(&self, url: &str) -> Result<ServoUrl, url::ParseError> {

Run the Location tests with ./mach test-wpt tests/wpt/tests/html/browsers/history/the-location-interface to see if there are any behaviour changes. It's possible that these particular APIs are not tested inside documents with non-UTF8 encodings.

Activity

  1. added
    A-content/dom
    E-less-complex
    on Mar 21, 2026
  2. servo-highfive commented on Mar 21, 2026

    @servo-highfive

    Hi! If you have any questions regarding this issue, feel free to make a comment here, or ask it in Zulip.

    If you intend to work on this issue, then add @servo-highfive: assign me to your comment, and I'll assign this to you. 😄

  3. hkadijat commented on Mar 21, 2026

    @hkadijat

    @servo-highfive: assign me

  4. added
    C-assigned
    on Mar 21, 2026
  5. servo-highfive commented on Mar 21, 2026

    @servo-highfive

    Hey @hkadijat! Thanks for your interest in working on this issue. It's now assigned to you!

  6. jayant911 commented on Mar 22, 2026

    @jayant911
    Contributor

    Hey @hkadijat! if you are not working on this you can assign me.

  7. jdm commented on Mar 22, 2026

    @jdm
    MemberAuthor

    @jayant911 Please give assignees longer than one day before requesting reassignment. For issues labelled E-less-complex one week is an appropriate amount of time.

  8. jayant911 commented on Mar 22, 2026

    @jayant911
    Contributor

    Got it, thanks.

  9. jdm commented on Apr 11, 2026

    @jdm
    MemberAuthor

    @hkadijat Are you still working on this?

  10. TG199 commented on Apr 14, 2026

    @TG199
    Contributor

    @servo-highfive assign me

  11. servo-highfive commented on Apr 14, 2026

    @servo-highfive

    It looks like this has already been assigned to someone. I'll leave the decision to a core contributor.

  12. assigned and unassigned on Apr 14, 2026
  13. added a commit that references this issue on May 28, 2026
    6f7cc7f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-content/domC-assignedE-less-complex

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions