Skip to content

html/dom: a/area.username and .password are hardcoded to "" instead of reflecting the URL #70

Description

@ImLunaHey

Area: url / html/dom

Summary

The HTMLHyperlinkElementUtils username/password accessors on <a>/<area> are stubbed to a static empty string rather than derived from the element's parsed href, so the userinfo never round-trips.

FAIL  url/a-element.html
  — Parsing: <http://user:pass@foo:21/bar;par?b#c> against <http://example.org/foo/bar>:
    assert_equals: username expected "user" but got ""

In crates/js/src/bootstrap/browser_env.js, the URL-decomposition accessors (protocol/host/pathname/…) are wired to the parsed href via __defUrlPart, but username/password fall through to def(el, "username", "") / def(el, "password", "") — plain empty-string properties with no getter/setter.

Expected

Per HTML §dom-hyperlink-username / §dom-hyperlink-password: the getters return the resolved URL's username/password, and the setters percent-encode the value into the URL's userinfo and reserialize (no-op when the URL has no host / cannot have userinfo). The parser already extracts and serializes userinfo correctly — only these two accessors need wiring up, analogous to the existing __defUrlPart entries.

Good first issue

cargo run --release -p wpt-runner -- ./wpt url/a-element.html 1000

Metadata

Metadata

Labels

bugSomething isn't workingclaimedAn open issue someone is actively working ongood first issueGood for newcomers

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions