The origin attribute returns null instead of empty on on invalid URL. The URL spec says to return empty.
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
<rdar://problem/114078288>
Pull request: https://github.com/WebKit/WebKit/pull/16830
Committed 267222@main (0e09f4e4a3b4): <https://commits.webkit.org/267222@main> Reviewed commits have been landed. Closing PR #16830 and removing active labels.