Changeset 284478 in webkit


Ignore:
Timestamp:
Oct 19, 2021 12:28:40 PM (9 months ago)
Author:
commit-queue@webkit.org
Message:

Origin of opaque blob: URLs ends up as empty string
https://bugs.webkit.org/show_bug.cgi?id=231942

Patch by Alex Christensen <achristensen@webkit.org> on 2021-10-19
Reviewed by Tim Horton.

LayoutTests/imported/w3c:

  • web-platform-tests/url/a-element-expected.txt:
  • web-platform-tests/url/a-element-origin-expected.txt:
  • web-platform-tests/url/a-element-origin-xhtml-expected.txt:
  • web-platform-tests/url/a-element-xhtml-expected.txt:
  • web-platform-tests/url/resources/urltestdata.json:
  • web-platform-tests/url/url-constructor.any-expected.txt:
  • web-platform-tests/url/url-constructor.any.worker-expected.txt:
  • web-platform-tests/url/url-origin.any-expected.txt:
  • web-platform-tests/url/url-origin.any.worker-expected.txt:

Source/WebCore:

It should be "null" instead of "".
This matches Chrome and Firefox.
Covered by a PR to WPT included in this patch.

  • page/SecurityOrigin.cpp:

(WebCore::shouldTreatAsUniqueOrigin):

Location:
trunk
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r284477 r284478  
     12021-10-19  Alex Christensen  <achristensen@webkit.org>
     2
     3        Origin of opaque blob: URLs ends up as empty string
     4        https://bugs.webkit.org/show_bug.cgi?id=231942
     5
     6        Reviewed by Tim Horton.
     7
     8        * web-platform-tests/url/a-element-expected.txt:
     9        * web-platform-tests/url/a-element-origin-expected.txt:
     10        * web-platform-tests/url/a-element-origin-xhtml-expected.txt:
     11        * web-platform-tests/url/a-element-xhtml-expected.txt:
     12        * web-platform-tests/url/resources/urltestdata.json:
     13        * web-platform-tests/url/url-constructor.any-expected.txt:
     14        * web-platform-tests/url/url-constructor.any.worker-expected.txt:
     15        * web-platform-tests/url/url-origin.any-expected.txt:
     16        * web-platform-tests/url/url-origin.any.worker-expected.txt:
     17
    1182021-10-19  Chris Dumez  <cdumez@apple.com>
    219
  • trunk/LayoutTests/imported/w3c/web-platform-tests/url/a-element-expected.txt

    r281963 r284478  
    592592PASS Parsing: <blob:https://example.com:443/> against <about:blank>
    593593PASS Parsing: <blob:d3958f5c-0777-0845-9dcf-2cb28783acaf> against <about:blank>
     594PASS Parsing: <blob:> against <about:blank>
    594595PASS Parsing: <http://0x7f.0.0.0x7g> against <about:blank>
    595596PASS Parsing: <http://0X7F.0.0.0X7G> against <about:blank>
  • trunk/LayoutTests/imported/w3c/web-platform-tests/url/a-element-origin-expected.txt

    r281963 r284478  
    321321PASS Parsing origin: <urn:ietf:rfc:2648> against <about:blank>
    322322PASS Parsing origin: <tag:joe@example.org,2001:foo/bar> against <about:blank>
     323PASS Parsing origin: <blob:https://example.com:443/> against <about:blank>
     324PASS Parsing origin: <blob:d3958f5c-0777-0845-9dcf-2cb28783acaf> against <about:blank>
     325PASS Parsing origin: <blob:> against <about:blank>
    323326PASS Parsing origin: <non-special:cannot-be-a-base-url-\0
    324327~€> against <about:blank>
  • trunk/LayoutTests/imported/w3c/web-platform-tests/url/a-element-origin-xhtml-expected.txt

    r281963 r284478  
    321321PASS Parsing origin: <urn:ietf:rfc:2648> against <about:blank>
    322322PASS Parsing origin: <tag:joe@example.org,2001:foo/bar> against <about:blank>
     323PASS Parsing origin: <blob:https://example.com:443/> against <about:blank>
     324PASS Parsing origin: <blob:d3958f5c-0777-0845-9dcf-2cb28783acaf> against <about:blank>
     325PASS Parsing origin: <blob:> against <about:blank>
    323326PASS Parsing origin: <non-special:cannot-be-a-base-url-\0
    324327~€> against <about:blank>
  • trunk/LayoutTests/imported/w3c/web-platform-tests/url/a-element-xhtml-expected.txt

    r281963 r284478  
    592592PASS Parsing: <blob:https://example.com:443/> against <about:blank>
    593593PASS Parsing: <blob:d3958f5c-0777-0845-9dcf-2cb28783acaf> against <about:blank>
     594PASS Parsing: <blob:> against <about:blank>
    594595PASS Parsing: <http://0x7f.0.0.0x7g> against <about:blank>
    595596PASS Parsing: <http://0X7F.0.0.0X7G> against <about:blank>
  • trunk/LayoutTests/imported/w3c/web-platform-tests/url/resources/urltestdata.json

    r281963 r284478  
    73047304    "base": "about:blank",
    73057305    "href": "blob:https://example.com:443/",
     7306    "origin": "https://example.com",
    73067307    "protocol": "blob:",
    73077308    "username": "",
     
    73187319    "base": "about:blank",
    73197320    "href": "blob:d3958f5c-0777-0845-9dcf-2cb28783acaf",
     7321    "origin": "null",
    73207322    "protocol": "blob:",
    73217323    "username": "",
     
    73257327    "port": "",
    73267328    "pathname": "d3958f5c-0777-0845-9dcf-2cb28783acaf",
     7329    "search": "",
     7330    "hash": ""
     7331  },
     7332  {
     7333    "input": "blob:",
     7334    "base": "about:blank",
     7335    "href": "blob:",
     7336    "origin": "null",
     7337    "protocol": "blob:",
     7338    "username": "",
     7339    "password": "",
     7340    "host": "",
     7341    "hostname": "",
     7342    "port": "",
     7343    "pathname": "",
    73277344    "search": "",
    73287345    "hash": ""
  • trunk/LayoutTests/imported/w3c/web-platform-tests/url/url-constructor.any-expected.txt

    r281963 r284478  
    591591PASS Parsing: <blob:https://example.com:443/> against <about:blank>
    592592PASS Parsing: <blob:d3958f5c-0777-0845-9dcf-2cb28783acaf> against <about:blank>
     593PASS Parsing: <blob:> against <about:blank>
    593594PASS Parsing: <http://0x7f.0.0.0x7g> against <about:blank>
    594595PASS Parsing: <http://0X7F.0.0.0X7G> against <about:blank>
  • trunk/LayoutTests/imported/w3c/web-platform-tests/url/url-constructor.any.worker-expected.txt

    r281963 r284478  
    591591PASS Parsing: <blob:https://example.com:443/> against <about:blank>
    592592PASS Parsing: <blob:d3958f5c-0777-0845-9dcf-2cb28783acaf> against <about:blank>
     593PASS Parsing: <blob:> against <about:blank>
    593594PASS Parsing: <http://0x7f.0.0.0x7g> against <about:blank>
    594595PASS Parsing: <http://0X7F.0.0.0X7G> against <about:blank>
  • trunk/LayoutTests/imported/w3c/web-platform-tests/url/url-origin.any-expected.txt

    r281963 r284478  
    320320PASS Origin parsing: <urn:ietf:rfc:2648> against <about:blank>
    321321PASS Origin parsing: <tag:joe@example.org,2001:foo/bar> against <about:blank>
     322PASS Origin parsing: <blob:https://example.com:443/> against <about:blank>
     323PASS Origin parsing: <blob:d3958f5c-0777-0845-9dcf-2cb28783acaf> against <about:blank>
     324PASS Origin parsing: <blob:> against <about:blank>
    322325PASS Origin parsing: <non-special:cannot-be-a-base-url-\0
    323326~€> against <about:blank>
  • trunk/LayoutTests/imported/w3c/web-platform-tests/url/url-origin.any.worker-expected.txt

    r281963 r284478  
    320320PASS Origin parsing: <urn:ietf:rfc:2648> against <about:blank>
    321321PASS Origin parsing: <tag:joe@example.org,2001:foo/bar> against <about:blank>
     322PASS Origin parsing: <blob:https://example.com:443/> against <about:blank>
     323PASS Origin parsing: <blob:d3958f5c-0777-0845-9dcf-2cb28783acaf> against <about:blank>
     324PASS Origin parsing: <blob:> against <about:blank>
    322325PASS Origin parsing: <non-special:cannot-be-a-base-url-\0
    323326~€> against <about:blank>
  • trunk/Source/WebCore/ChangeLog

    r284472 r284478  
     12021-10-19  Alex Christensen  <achristensen@webkit.org>
     2
     3        Origin of opaque blob: URLs ends up as empty string
     4        https://bugs.webkit.org/show_bug.cgi?id=231942
     5
     6        Reviewed by Tim Horton.
     7
     8        It should be "null" instead of "".
     9        This matches Chrome and Firefox.
     10        Covered by a PR to WPT included in this patch.
     11
     12        * page/SecurityOrigin.cpp:
     13        (WebCore::shouldTreatAsUniqueOrigin):
     14
    1152021-10-19  Youenn Fablet  <youenn@apple.com>
    216
  • trunk/Source/WebCore/page/SecurityOrigin.cpp

    r278894 r284478  
    9999    // FIXME: Do we need to unwrap the URL further?
    100100    URL innerURL = SecurityOrigin::shouldUseInnerURL(url) ? SecurityOrigin::extractInnerURL(url) : url;
    101 
    102     // FIXME: Check whether innerURL is valid.
     101    if (!innerURL.isValid())
     102        return true;
    103103
    104104    // For edge case URLs that were probably misparsed, make sure that the origin is unique.
Note: See TracChangeset for help on using the changeset viewer.