Closed Bug 1819323 Opened 2 years ago Closed 2 years ago

Fix pathname from anchor element's URL

Categories

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

Firefox 110
defect

Tracking

()

RESOLVED FIXED
112 Branch
Tracking Status
firefox112 --- fixed

People

(Reporter: cybai, Assigned: cybai)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/110.0

Steps to reproduce:

Based on the test result in url/a-element-xhtml.xhtml?include=javascript and friends, currently, most of the tests fail because the pathname doesn't match.

Actual results:

When anchor element's href is javascript:/example.com/, its pathname is empty string now.

Expected results:

When anchor element's href is javascript:/example.com/, its pathname should be /example.com/.

I've figured out how to fix it. I will send a patch.

nsIURI fails to cast to nsIURL so we used to get a nil url and
return empty string for pathname. As we're able to get the pathname
information from URI, I wonder we can just use it directly without
casting to nsIURL. With doing so, we can fix the issue.

Assignee: nobody → cyb.ai.815
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Attachment #9320291 - Attachment description: Bug 1819323 - Avoid casting nsIURI to nsIURL for GetPathname in Link. r?emilio → Bug 1819323 - Avoid casting nsIURI to nsIURL in Link. r?emilio
Component: Untriaged → DOM: Core & HTML
Product: Firefox → Core
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/f883d6d51f1a Avoid casting nsIURI to nsIURL in Link. r=emilio
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 112 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: