Changeset 51799 in webkit


Ignore:
Timestamp:
Dec 7, 2009 2:50:15 PM (14 years ago)
Author:
eric@webkit.org
Message:

2009-12-07 Kent Tamura <tkent@chromium.org>

Reviewed by Darin Adler.

Some changes to ValidityState-typeMismatch-url.html.
https://bugs.webkit.org/show_bug.cgi?id=29913

  • Add more test cases Username, IPv6 address, mailto:, file:, tel:, fragment, and IDN.
  • Handle difference between KURL and KURLGoogle
  • fast/forms/ValidityState-typeMismatch-url-expected.txt:
  • fast/forms/script-tests/ValidityState-typeMismatch-url.js:

2009-12-07 Kent Tamura <tkent@chromium.org>

Reviewed by Darin Adler.

Fix a bug that KURL rejects a host name which has an IPv4 address
inside an IPv6 form like [::127.0.0.1].
https://bugs.webkit.org/show_bug.cgi?id=29913

  • platform/KURL.cpp: (WebCore::characterClassTable): Add IPv6Char to '.'.
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r51798 r51799  
     12009-12-07  Kent Tamura  <tkent@chromium.org>
     2
     3        Reviewed by Darin Adler.
     4
     5        Some changes to ValidityState-typeMismatch-url.html.
     6        https://bugs.webkit.org/show_bug.cgi?id=29913
     7
     8        - Add more test cases
     9          Username, IPv6 address, mailto:, file:, tel:, fragment, and IDN.
     10        - Handle difference between KURL and KURLGoogle
     11
     12        * fast/forms/ValidityState-typeMismatch-url-expected.txt:
     13        * fast/forms/script-tests/ValidityState-typeMismatch-url.js:
     14
    1152009-12-07  Darin Fisher  <darin@chromium.org>
    216
  • trunk/LayoutTests/fast/forms/ValidityState-typeMismatch-url-expected.txt

    r48318 r51799  
    55
    66PASS http://www.google.com is a correct valid url.
     7PASS http://foo:bar@www.google.com:80 is a correct valid url.
    78PASS http://localhost is a correct valid url.
    89PASS http://127.0.0.1 is a correct valid url.
     10PASS http://[0000:0000:0000:0000:0000:0000:7f00:0001]/ is a correct valid url.
     11PASS http://[0000:0000:0000:0000:0000:0000:127.0.0.1]/ is a correct valid url.
     12PASS http://[::7f00:0001]/ is a correct valid url.
     13PASS http://[1::2:3]/ is a correct valid url.
     14PASS http://[0000:0::ffff:10.0.0.1]/ is a correct valid url.
    915PASS http://a is a correct valid url.
    1016PASS http://www.google.com/search?rls=en&q=WebKit&ie=UTF-8&oe=UTF-8 is a correct valid url.
    1117PASS ftp://ftp.myhost.com is a correct valid url.
    1218PASS ssh://ssh.myhost.com is a correct valid url.
     19PASS mailto:tkent@chromium.org is a correct valid url.
     20PASS mailto:tkent@chromium.org?body=hello is a correct valid url.
     21PASS file:///Users/tkent/.zshrc is a correct valid url.
     22PASS file:///C:/human.sys is a correct valid url.
     23PASS tel:+1-800-12345;ext=9999 is a correct valid url.
     24PASS tel:03(1234)5678 is a correct valid url.
    1325PASS somescheme://ssh.myhost.com is a correct valid url.
    1426PASS http://a/\/''*<>/ is a correct valid url.
    1527PASS http://a/dfs/kds@sds is a correct valid url.
    1628PASS http://a.a:1/search?a&b is a correct valid url.
     29PASS http://www.google.com/#top is a correct valid url.
     30PASS http://テスト。jp/パス?名前=値 is a correct valid url.
    1731PASS www.google.com is a correct invalid url.
    1832PASS 127.0.0.1 is a correct invalid url.
    1933PASS .com is a correct invalid url.
    20 PASS http://www.g**gle.com is a correct invalid url.
    2134PASS http://www.google.com:aaaa is a correct invalid url.
    22 PASS http:// www.google.com is a correct invalid url.
    23 PASS http://www .google.com is a correct invalid url.
    24 PASS http://www.&#10;google.&#13;com is a correct invalid url.
    2535PASS :// is a correct invalid url.
    2636PASS /http://www.google.com is a correct invalid url.
    2737PASS ----ftp://a is a correct invalid url.
    2838PASS scheme//a is a correct invalid url.
     39PASS http://[v8.:::]/ is a correct invalid url.
     40PASS http:// www.google.com is a correct invalid url.
     41PASS http://www .google.com is a correct invalid url.
     42PASS http://www.&#10;google.&#13;com is a correct invalid url.
    2943PASS http://host+ is a correct invalid url.
    3044PASS http://myurl! is a correct invalid url.
  • trunk/LayoutTests/fast/forms/script-tests/ValidityState-typeMismatch-url.js

    r48552 r51799  
    1212}
    1313
     14function expectValid(value) {
     15    check(value, false);
     16}
     17
     18function expectInvalid(value) {
     19    check(value, true);
     20}
     21
    1422var i = document.createElement('input');
    1523i.type = 'url';
    1624
    1725// Valid values
    18 check('http://www.google.com', false);
    19 check('http://localhost', false);
    20 check('http://127.0.0.1', false);
    21 check('http://a', false);
    22 check('http://www.google.com/search?rls=en&q=WebKit&ie=UTF-8&oe=UTF-8', false);
    23 check('ftp://ftp.myhost.com', false);
    24 check('ssh://ssh.myhost.com', false);
    25 check('somescheme://ssh.myhost.com', false);
    26 check('http://a/\\\/\'\'*<>/', false);
    27 check('http://a/dfs/\kds@sds', false);
    28 check('http://a.a:1/search?a&b', false);
     26expectValid('http://www.google.com');
     27expectValid('http://foo:bar@www.google.com:80');
     28expectValid('http://localhost');
     29expectValid('http://127.0.0.1');
     30expectValid('http://[0000:0000:0000:0000:0000:0000:7f00:0001]/');
     31expectValid('http://[0000:0000:0000:0000:0000:0000:127.0.0.1]/');
     32expectValid('http://[::7f00:0001]/');
     33expectValid('http://[1::2:3]/');
     34expectValid('http://[0000:0::ffff:10.0.0.1]/');
     35expectValid('http://a');
     36expectValid('http://www.google.com/search?rls=en&q=WebKit&ie=UTF-8&oe=UTF-8');
     37expectValid('ftp://ftp.myhost.com');
     38expectValid('ssh://ssh.myhost.com');
     39expectValid('mailto:tkent@chromium.org');
     40expectValid('mailto:tkent@chromium.org?body=hello');
     41expectValid('file:///Users/tkent/.zshrc');
     42expectValid('file:///C:/human.sys');
     43expectValid('tel:+1-800-12345;ext=9999');
     44expectValid('tel:03(1234)5678');
     45expectValid('somescheme://ssh.myhost.com');
     46expectValid('http://a/\\\/\'\'*<>/');
     47expectValid('http://a/dfs/\kds@sds');
     48expectValid('http://a.a:1/search?a&b');
     49expectValid('http://www.google.com/#top');
     50expectValid('http://\u30C6\u30B9\u30C8\u3002jp/\u30D1\u30B9?\u540D\u524D=\u5024');
    2951
    3052// Invalid values
    31 check('www.google.com', true);
    32 check('127.0.0.1', true);
    33 check('.com', true);
    34 check('http://www.g**gle.com', true);
    35 check('http://www.google.com:aaaa', true);
    36 check('http:// www.google.com', true);
    37 check('http://www .google.com', true);
    38 check('http://www.&#10;google.&#13;com', true);
    39 check('://', true);
    40 check('/http://www.google.com', true);
    41 check('----ftp://a', true);
    42 check('scheme//a', true);
    43 check('http://host+', true);
    44 check('http://myurl!', true);
     53expectInvalid('www.google.com');
     54expectInvalid('127.0.0.1');
     55expectInvalid('.com');
     56expectInvalid('http://www.google.com:aaaa');
     57expectInvalid('://');
     58expectInvalid('/http://www.google.com');
     59expectInvalid('----ftp://a');
     60expectInvalid('scheme//a');
     61expectInvalid('http://[v8.:::]/');
     62
     63// KURL's host name restriction is stricter than RFC 3986. KURLGoogle is not.
     64i.value = 'http://www.g**gle.com'
     65var strictHost = i.validity.typeMismatch;
     66if (strictHost) {
     67    expectInvalid('http:// www.google.com');
     68    expectInvalid('http://www .google.com');
     69    expectInvalid('http://www.&#10;google.&#13;com');
     70    expectInvalid('http://host+');
     71    expectInvalid('http://myurl!');
     72} else {
     73    expectValid('http:// www.google.com');
     74    expectValid('http://www .google.com');
     75    expectValid('http://www.&#10;google.&#13;com');
     76    expectValid('http://host+');
     77    expectValid('http://myurl!');
     78}
    4579
    4680var successfullyParsed = true;
  • trunk/WebCore/ChangeLog

    r51796 r51799  
     12009-12-07  Kent Tamura  <tkent@chromium.org>
     2
     3        Reviewed by Darin Adler.
     4
     5        Fix a bug that KURL rejects a host name which has an IPv4 address
     6        inside an IPv6 form like [::127.0.0.1].
     7        https://bugs.webkit.org/show_bug.cgi?id=29913
     8
     9        * platform/KURL.cpp:
     10        (WebCore::characterClassTable): Add IPv6Char to '.'.
     11
    1122009-12-07  Brady Eidson  <beidson@apple.com>
    213
  • trunk/WebCore/platform/KURL.cpp

    r51703 r51799  
    103103    /* 44  , */ UserInfoChar,
    104104    /* 45  - */ SchemeChar | UserInfoChar | HostnameChar,
    105     /* 46  . */ SchemeChar | UserInfoChar | HostnameChar,
     105    /* 46  . */ SchemeChar | UserInfoChar | HostnameChar | IPv6Char,
    106106    /* 47  / */ PathSegmentEndChar,
    107107    /* 48  0 */ SchemeChar | UserInfoChar | HostnameChar | IPv6Char,
Note: See TracChangeset for help on using the changeset viewer.