Changeset 205584 in webkit


Ignore:
Timestamp:
Sep 7, 2016 10:59:38 PM (8 years ago)
Author:
achristensen@apple.com
Message:

Roll out r205580 and r205582.
https://bugs.webkit.org/show_bug.cgi?id=161668

I need to figure out why this is failing on the bots before landing any more URLParser progress.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r205583 r205584  
     12016-09-07  Alex Christensen  <achristensen@webkit.org>
     2
     3        Roll out r205580 and r205582.
     4        https://bugs.webkit.org/show_bug.cgi?id=161668
     5
     6        I need to figure out why this is failing on the bots before landing any more URLParser progress.
     7
    182016-09-07  Yusuke Suzuki  <utatane.tea@gmail.com>
    29
  • trunk/Source/WebCore/platform/URLParser.cpp

    r205582 r205584  
    2929#include "Logging.h"
    3030#include <array>
    31 #include <unicode/uidna.h>
    3231#include <wtf/HashMap.h>
    3332#include <wtf/NeverDestroyed.h>
     
    452451            LOG_STATE("SchemeEndCheckForSlashes");
    453452            if (*c == '/') {
    454                 m_buffer.append("//");
    455                 m_url.m_userStart = m_buffer.length();
     453                m_buffer.append('/');
    456454                state = State::PathOrAuthority;
    457455                ++c;
     
    518516            case '?':
    519517                copyURLPartsUntil(base, URLPart::PathEnd);
    520                 m_buffer.append('?');
    521518                state = State::Query;
    522519                ++c;
     
    524521            case '#':
    525522                copyURLPartsUntil(base, URLPart::QueryEnd);
    526                 m_buffer.append('#');
    527523                state = State::Fragment;
    528524                ++c;
     
    846842    case State::RelativeSlash:
    847843        LOG_FINAL_STATE("RelativeSlash");
    848         copyURLPartsUntil(base, URLPart::PortEnd);
    849         m_buffer.append('/');
    850         m_url.m_pathAfterLastSlash = base.m_portEnd + 1;
    851         m_url.m_pathEnd = m_url.m_pathAfterLastSlash;
    852         m_url.m_queryEnd = m_url.m_pathAfterLastSlash;
    853         m_url.m_fragmentEnd = m_url.m_pathAfterLastSlash;
    854844        break;
    855845    case State::SpecialAuthoritySlashes:
     
    12801270}
    12811271
    1282 static bool containsOnlyASCII(const String& string)
    1283 {
    1284     if (string.is8Bit())
    1285         return charactersAreAllASCII(string.characters8(), string.length());
    1286     return charactersAreAllASCII(string.characters16(), string.length());
    1287 }
    1288 
    12891272static Optional<String> domainToASCII(const String& domain)
    12901273{
    1291     const unsigned hostnameBufferLength = 2048;
    1292 
    1293     if (containsOnlyASCII(domain)) {
    1294         if (domain.is8Bit())
    1295             return domain;
    1296         Vector<LChar, hostnameBufferLength> buffer;
    1297         size_t length = domain.length();
    1298         buffer.reserveInitialCapacity(length);
    1299         for (size_t i = 0; i < length; ++i)
    1300             buffer.append(domain[i]);
    1301         return String(buffer.data(), length);
    1302     }
    1303    
    1304     UChar hostnameBuffer[hostnameBufferLength];
    1305 
    1306     // FIXME: This is slow, but it covers up a mysterious bug on the bots when logging is disabled.
    1307     // The URLParser should not be enabled until this bug is found and resolved.
    1308     // See https://bugs.webkit.org/show_bug.cgi?id=161668
    1309     memset(hostnameBuffer, 0, sizeof(hostnameBuffer));
    1310 
    1311     UErrorCode error = U_ZERO_ERROR;
    1312    
    1313     int32_t numCharactersConverted = uidna_IDNToASCII(StringView(domain).upconvertedCharacters(), domain.length(), hostnameBuffer, hostnameBufferLength, UIDNA_ALLOW_UNASSIGNED, nullptr, &error);
    1314 
    1315     if (error == U_ZERO_ERROR) {
    1316         LChar buffer[hostnameBufferLength];
    1317         for (int32_t i = 0; i < numCharactersConverted; ++i) {
    1318             ASSERT(isASCII(hostnameBuffer[i]));
    1319             buffer[i] = hostnameBuffer[i];
    1320         }
    1321         return String(buffer, numCharactersConverted);
    1322     }
    1323 
    1324     // FIXME: Check for U_BUFFER_OVERFLOW_ERROR and retry with an allocated buffer.
    1325     return Nullopt;
     1274    // FIXME: Implement correctly
     1275    CString utf8 = domain.utf8();
     1276    return String(utf8.data(), utf8.length());
    13261277}
    13271278
  • trunk/Tools/ChangeLog

    r205580 r205584  
     12016-09-07  Alex Christensen  <achristensen@webkit.org>
     2
     3        Roll out r205580 and r205582.
     4        https://bugs.webkit.org/show_bug.cgi?id=161668
     5
     6        I need to figure out why this is failing on the bots before landing any more URLParser progress.
     7
    182016-09-07  Alex Christensen  <achristensen@webkit.org>
    29
  • trunk/Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp

    r205580 r205584  
    8383   
    8484    EXPECT_TRUE(URLParser::allValuesEqual(url, oldURL));
    85 }
    86 
    87 template<size_t length>
    88 static String wideString(const wchar_t (&url)[length])
    89 {
    90     StringBuilder builder;
    91     builder.reserveCapacity(length - 1);
    92     for (size_t i = 0; i < length - 1; ++i)
    93         builder.append(url[i]);
    94     return builder.toString();
    9585}
    9686
     
    220210    checkRelativeURL("http://example\t.\norg", "http://example.org/foo/bar", {"http", "", "", "example.org", 0, "/", "", "", "http://example.org/"});
    221211    checkRelativeURL("test", "file:///path1/path2", {"file", "", "", "", 0, "/path1/test", "", "", "file:///path1/test"});
    222     checkRelativeURL(wideString(L"http://www.foo。bar.com"), "http://other.com/", {"http", "", "", "www.foo.bar.com", 0, "/", "", "", "http://www.foo.bar.com/"});
    223     checkRelativeURL(wideString(L"sc://ñ.test/"), "about:blank", {"sc", "", "", "xn--ida.test", 0, "/", "", "", "sc://xn--ida.test/"});
    224     checkRelativeURL("#fragment", "http://host/path", {"http", "", "", "host", 0, "/path", "", "fragment", "http://host/path#fragment"});
    225     checkRelativeURL("?query", "http://host/path", {"http", "", "", "host", 0, "/path", "query", "", "http://host/path?query"});
    226     checkRelativeURL("?query#fragment", "http://host/path", {"http", "", "", "host", 0, "/path", "query", "fragment", "http://host/path?query#fragment"});
    227     checkRelativeURL(wideString(L"?β"), "http://example.org/foo/bar", {"http", "", "", "example.org", 0, "/foo/bar", "%CE%B2", "", "http://example.org/foo/bar?%CE%B2"});
    228     checkRelativeURL("?", "http://example.org/foo/bar", {"http", "", "", "example.org", 0, "/foo/bar", "", "", "http://example.org/foo/bar?"});
    229     checkRelativeURL("#", "http://example.org/foo/bar", {"http", "", "", "example.org", 0, "/foo/bar", "", "", "http://example.org/foo/bar#"});
    230     checkRelativeURL("?#", "http://example.org/foo/bar", {"http", "", "", "example.org", 0, "/foo/bar", "", "", "http://example.org/foo/bar?#"});
    231     checkRelativeURL("#?", "http://example.org/foo/bar", {"http", "", "", "example.org", 0, "/foo/bar", "", "?", "http://example.org/foo/bar#?"});
    232     checkRelativeURL("/", "http://example.org/foo/bar", {"http", "", "", "example.org", 0, "/", "", "", "http://example.org/"});
    233212}
    234213
     
    352331        {"file", "", "", "[0:a::b:c:0:0]", 0, "/path", "", "", "file://[0:a::b:c:0:0]/path"},
    353332        {"file", "", "", "[0:a:0:0:b:c:0:0]", 0, "/path", "", "", "file://[0:a:0:0:b:c:0:0]/path"});
    354     checkRelativeURLDifferences(wideString(L"#β"), "http://example.org/foo/bar",
    355         {"http", "", "", "example.org", 0, "/foo/bar", "", wideString(L"β"), wideString(L"http://example.org/foo/bar#β")},
    356         {"http", "", "", "example.org", 0, "/foo/bar", "", "%CE%B2", "http://example.org/foo/bar#%CE%B2"});
    357333
    358334    // FIXME: This behavior ought to be specified in the standard.
     
    376352   
    377353    // URLParser matches Chrome and the spec, but not URL::parse or Firefox.
    378     checkURLDifferences(wideString(L"http://0Xc0.0250.01"),
    379         {"http", "", "", "192.168.0.1", 0, "/", "", "", "http://192.168.0.1/"},
    380         {"http", "", "", "0xc0.0250.01", 0, "/", "", "", "http://0xc0.0250.01/"});
    381354    checkURLDifferences("http://host/path%2e.%2E",
    382355        {"http", "", "", "host", 0, "/path...", "", "", "http://host/path..."},
Note: See TracChangeset for help on using the changeset viewer.