Bug 128020 - <a>/<area>'s origin getter returns "null" rather than "" when URL cannot be parsed
Summary: <a>/<area>'s origin getter returns "null" rather than "" when URL cannot be p...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Anne van Kesteren
URL:
Keywords: BrowserCompat, InRadar
Depends on:
Blocks: 128023
  Show dependency treegraph
 
Reported: 2014-01-31 14:41 PST by Maciej Stachowiak
Modified: 2023-08-24 02:11 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Maciej Stachowiak 2014-01-31 14:41:35 PST
The origin attribute returns null instead of empty on on invalid URL. The URL spec says to return empty.
Comment 1 Anne van Kesteren 2023-08-18 03:21:30 PDT
This only applies to the <a> and <area> elements I think (not sure how to construct a URL or Location from a string that cannot be parsed as a URL), but it's still applicable and is probably not difficult to fix:

http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E%0A...%3Cscript%3E%0Aa%3Ddocument.createElement(%22a%22)%3B%0Aa.href%3D%22https%3A%2F%2Ftest%3Atest%2F%22%3B%0Aw(a.origin)%3B%0A%3C%2Fscript%3E
Comment 2 Radar WebKit Bug Importer 2023-08-18 04:02:26 PDT
<rdar://problem/114078288>
Comment 3 Anne van Kesteren 2023-08-18 04:14:42 PDT
Pull request: https://github.com/WebKit/WebKit/pull/16830
Comment 4 EWS 2023-08-24 02:11:08 PDT
Committed 267222@main (0e09f4e4a3b4): <https://commits.webkit.org/267222@main>

Reviewed commits have been landed. Closing PR #16830 and removing active labels.