⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 211058 in webkit


Ignore:
Timestamp:
Jan 23, 2017, 1:30:32 PM (10 years ago)
Author:
achristensen@apple.com
Message:

Make URLs with non-special schemes and a query or fragment but no slash after the host more compatible
https://bugs.webkit.org/show_bug.cgi?id=167317
Source/WebCore:

<rdar://problem/29526875>

Reviewed by Sam Weinig.

This is currently being added to the URL spec in https://github.com/whatwg/url/issues/212
Covered by new API tests.

  • platform/URLParser.cpp:

(WebCore::URLParser::parse):
Only add a slash if there wasn't one if the URL has a special scheme.
This new behavior matches the old behavior of URL::parse.

Tools:

Reviewed by Sam Weinig.

  • TestWebKitAPI/Tests/WebCore/URLParser.cpp:

(TestWebKitAPI::TEST_F):

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r211055 r211058  
     12017-01-23  Alex Christensen  <achristensen@webkit.org>
     2
     3        Make URLs with non-special schemes and a query or fragment but no slash after the host more compatible
     4        https://bugs.webkit.org/show_bug.cgi?id=167317
     5        <rdar://problem/29526875>
     6
     7        Reviewed by Sam Weinig.
     8
     9        This is currently being added to the URL spec in https://github.com/whatwg/url/issues/212
     10        Covered by new API tests.
     11
     12        * platform/URLParser.cpp:
     13        (WebCore::URLParser::parse):
     14        Only add a slash if there wasn't one if the URL has a special scheme.
     15        This new behavior matches the old behavior of URL::parse.
     16
    1172017-01-23  Joseph Pecoraro  <pecoraro@apple.com>
    218
  • trunk/Source/WebCore/platform/URLParser.cpp

    r211001 r211058  
    14631463                        }
    14641464                        if (UNLIKELY(!isSlash)) {
    1465                             syntaxViolation(c);
    1466                             appendToASCIIBuffer('/');
     1465                            if (m_urlIsSpecial) {
     1466                                syntaxViolation(c);
     1467                                appendToASCIIBuffer('/');
     1468                            }
    14671469                            m_url.m_pathAfterLastSlash = currentPosition(c);
    14681470                        }
  • trunk/Tools/ChangeLog

    r211048 r211058  
     12017-01-23  Alex Christensen  <achristensen@webkit.org>
     2
     3        Make URLs with non-special schemes and a query or fragment but no slash after the host more compatible
     4        https://bugs.webkit.org/show_bug.cgi?id=167317
     5
     6        Reviewed by Sam Weinig.
     7
     8        * TestWebKitAPI/Tests/WebCore/URLParser.cpp:
     9        (TestWebKitAPI::TEST_F):
     10
    1112017-01-23  Jonathan Bedard  <jbedard@apple.com>
    212
  • trunk/Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp

    r209857 r211058  
    631631    checkRelativeURL("?query", "applewebdata://Host", {"applewebdata", "", "", "Host", 0, "", "query", "", "applewebdata://Host?query"});
    632632    checkRelativeURL("#fragment", "applewebdata://Host", {"applewebdata", "", "", "Host", 0, "", "", "fragment", "applewebdata://Host#fragment"});
     633    checkRelativeURL("notspecial://something?", "file:////var//containers//stuff/", {"notspecial", "", "", "something", 0, "", "", "", "notspecial://something?"}, TestTabs::No);
     634    checkRelativeURL("notspecial://something#", "file:////var//containers//stuff/", {"notspecial", "", "", "something", 0, "", "", "", "notspecial://something#"}, TestTabs::No);
     635    checkRelativeURL("http://something?", "file:////var//containers//stuff/", {"http", "", "", "something", 0, "/", "", "", "http://something/?"}, TestTabs::No);
     636    checkRelativeURL("http://something#", "file:////var//containers//stuff/", {"http", "", "", "something", 0, "/", "", "", "http://something/#"}, TestTabs::No);
    633637
    634638    // The checking of slashes in SpecialAuthoritySlashes needed to get this to pass contradicts what is in the spec,
Note: See TracChangeset for help on using the changeset viewer.