[webkit-changes] [WebKit/WebKit] 0e09f4: <a>/<area>'s origin getter returns "null" rather t...

Anne van Kesteren noreply at github.com
Thu Aug 24 02:11:17 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 0e09f4e4a3b4803ec38c243cc8aaad0570cfd7fa
      https://github.com/WebKit/WebKit/commit/0e09f4e4a3b4803ec38c243cc8aaad0570cfd7fa
  Author: Anne van Kesteren <annevk at annevk.nl>
  Date:   2023-08-24 (Thu, 24 Aug 2023)

  Changed paths:
    M LayoutTests/fast/dom/HTMLAnchorElement/anchor-element-href-parsing-expected.txt
    M LayoutTests/fast/dom/HTMLAnchorElement/anchor-element-href-parsing.html
    M Source/WebCore/html/HTMLAnchorElement.cpp

  Log Message:
  -----------
  <a>/<area>'s origin getter returns "null" rather than "" when URL cannot be parsed
https://bugs.webkit.org/show_bug.cgi?id=128020
rdar://114078288

Reviewed by Brent Fulgham.

Check if the URL cannot be parsed first (isValid() in our code) and if
so, return the empty string. This aligns us with the HTML Standard and
other browsers.

This is not implemented in URLDecomposition as URL, Location, and
WorkerLocation always represent parsable URLs.

* LayoutTests/fast/dom/HTMLAnchorElement/anchor-element-href-parsing-expected.txt:
* LayoutTests/fast/dom/HTMLAnchorElement/anchor-element-href-parsing.html:

Add coverage for username and password getters while here.

* Source/WebCore/html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::origin const):

Canonical link: https://commits.webkit.org/267222@main




More information about the webkit-changes mailing list