Closed Bug 1647058 Opened 7 months ago Closed 7 months ago

Link opens the wrong URL fragment

Categories

(Core :: DOM: Core & HTML, defect)

77 Branch
defect

Tracking

()

RESOLVED FIXED
mozilla79
Tracking Status
firefox79 --- fixed

People

(Reporter: mail.levig, Assigned: emilio)

Details

Attachments

(2 files)

Attached file test.html

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:77.0) Gecko/20100101 Firefox/77.0

Steps to reproduce:

I have an HTML file with some javascript that contains a link to a fragment.
Clicking on the link doesn't do anything.

Actual results:

Nothing happened/the link opened the wrong fragment.

Expected results:

The link should have followed the location specified in the href attribute.

Component: Untriaged → DOM: Core & HTML
OS: Unspecified → Linux
Product: Firefox → Core
Hardware: Unspecified → x86_64

The .href of the link is a bit unexpected, and it keeps the existing fragment.

Minimal repro:

(new URL("#link", "https://example.org/##link")).href

Actual: https://example.org/##link

Expected: https://example.org/#link (probably)

Assignee: nobody → emilio
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7854dabb96fc
Fix an off-by-one in an URL creation optimization. r=valentin
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/24281 for changes under testing/web-platform/tests
Upstream web-platform-tests status checks passed, PR will merge once commit reaches central.
Status: UNCONFIRMED → RESOLVED
Closed: 7 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla79
Upstream PR merged by moz-wptsync-bot
OS: Linux → All
Hardware: x86_64 → All
You need to log in before you can comment on or make changes to this bug.