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

Changeset 288517 in webkit


Ignore:
Timestamp:
Jan 24, 2022, 5:56:06 PM (5 years ago)
Author:
Russell Epstein
Message:

Cherry-pick r288264. rdar://problem/87745419

Align our qualified name validation with the specification
​https://bugs.webkit.org/show_bug.cgi?id=201699

Reviewed by Geoffrey Garen.

LayoutTests/imported/w3c:

  • web-platform-tests/dom/nodes/DOMImplementation-createDocument-expected.txt:
  • web-platform-tests/dom/nodes/Document-createElementNS-expected.txt: Rebaseline WPT tests now that more checks are passing.

Source/WebCore:

Align our qualified name validation with the latest specification:

No new tests, rebaselined existing tests.

  • dom/Document.cpp: (WebCore::isValidNameStart): (WebCore::isValidNamePart):

LayoutTests:

  • dom/xhtml/level3/core/canonicalform06-expected.txt:
  • dom/xhtml/level3/core/infoset06-expected.txt:
  • dom/xhtml/level3/core/infoset07-expected.txt:
  • dom/xhtml/level3/core/wellformed01-expected.txt:
  • dom/xhtml/level3/core/wellformed02-expected.txt:
  • dom/xhtml/level3/core/wellformed03-expected.txt:
  • dom/xhtml/level3/core/wellformed04-expected.txt: Rebaseline outdated imported tests.
  • fast/dom/DOMImplementation/createDocument-namespace-err-expected.txt:
  • fast/dom/DOMImplementation/createDocument-namespace-err.html:
  • fast/dom/Document/createAttributeNS-namespace-err-expected.txt:
  • fast/dom/Document/createAttributeNS-namespace-err.html:
  • fast/dom/Document/createElement-invalid-names-expected.txt:
  • fast/dom/Document/createElement-invalid-names.html:
  • fast/dom/Document/createElementNS-namespace-err-expected.txt:
  • fast/dom/Document/createElementNS-namespace-err.html:
  • fast/dom/Element/setAttributeNS-namespace-err-expected.txt:
  • fast/dom/Element/setAttributeNS-namespace-err.html:
  • fast/dom/dataset-expected.txt:
  • fast/dom/dataset-xhtml-expected.txt:
  • fast/dom/dataset-xhtml.xhtml:
  • fast/dom/dataset.html: Update and rebaseline outdated WebKit tests.

git-svn-id: ​https://svn.webkit.org/repository/webkit/trunk@288264 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Location:
branches/safari-613-branch
Files:
27 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-613-branch/LayoutTests/ChangeLog

    r288516 r288517  
     12022-01-24  Alan Coon  <alancoon@apple.com>
     2
     3        Cherry-pick r288264. rdar://problem/87745419
     4
     5    Align our qualified name validation with the specification
     6    https://bugs.webkit.org/show_bug.cgi?id=201699
     7   
     8    Reviewed by Geoffrey Garen.
     9   
     10    LayoutTests/imported/w3c:
     11   
     12    * web-platform-tests/dom/nodes/DOMImplementation-createDocument-expected.txt:
     13    * web-platform-tests/dom/nodes/Document-createElementNS-expected.txt:
     14    Rebaseline WPT tests now that more checks are passing.
     15   
     16    Source/WebCore:
     17   
     18    Align our qualified name validation with the latest specification:
     19    - https://dom.spec.whatwg.org/#validate
     20    - https://www.w3.org/TR/xml/#NT-NameStartChar
     21   
     22    No new tests, rebaselined existing tests.
     23   
     24    * dom/Document.cpp:
     25    (WebCore::isValidNameStart):
     26    (WebCore::isValidNamePart):
     27   
     28    LayoutTests:
     29   
     30    * dom/xhtml/level3/core/canonicalform06-expected.txt:
     31    * dom/xhtml/level3/core/infoset06-expected.txt:
     32    * dom/xhtml/level3/core/infoset07-expected.txt:
     33    * dom/xhtml/level3/core/wellformed01-expected.txt:
     34    * dom/xhtml/level3/core/wellformed02-expected.txt:
     35    * dom/xhtml/level3/core/wellformed03-expected.txt:
     36    * dom/xhtml/level3/core/wellformed04-expected.txt:
     37    Rebaseline outdated imported tests.
     38   
     39    * fast/dom/DOMImplementation/createDocument-namespace-err-expected.txt:
     40    * fast/dom/DOMImplementation/createDocument-namespace-err.html:
     41    * fast/dom/Document/createAttributeNS-namespace-err-expected.txt:
     42    * fast/dom/Document/createAttributeNS-namespace-err.html:
     43    * fast/dom/Document/createElement-invalid-names-expected.txt:
     44    * fast/dom/Document/createElement-invalid-names.html:
     45    * fast/dom/Document/createElementNS-namespace-err-expected.txt:
     46    * fast/dom/Document/createElementNS-namespace-err.html:
     47    * fast/dom/Element/setAttributeNS-namespace-err-expected.txt:
     48    * fast/dom/Element/setAttributeNS-namespace-err.html:
     49    * fast/dom/dataset-expected.txt:
     50    * fast/dom/dataset-xhtml-expected.txt:
     51    * fast/dom/dataset-xhtml.xhtml:
     52    * fast/dom/dataset.html:
     53    Update and rebaseline outdated WebKit tests.
     54   
     55   
     56    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288264 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     57
     58    2022-01-19  Chris Dumez  <cdumez@apple.com>
     59
     60            Align our qualified name validation with the specification
     61            https://bugs.webkit.org/show_bug.cgi?id=201699
     62
     63            Reviewed by Geoffrey Garen.
     64
     65            * dom/xhtml/level3/core/canonicalform06-expected.txt:
     66            * dom/xhtml/level3/core/infoset06-expected.txt:
     67            * dom/xhtml/level3/core/infoset07-expected.txt:
     68            * dom/xhtml/level3/core/wellformed01-expected.txt:
     69            * dom/xhtml/level3/core/wellformed02-expected.txt:
     70            * dom/xhtml/level3/core/wellformed03-expected.txt:
     71            * dom/xhtml/level3/core/wellformed04-expected.txt:
     72            Rebaseline outdated imported tests.
     73
     74            * fast/dom/DOMImplementation/createDocument-namespace-err-expected.txt:
     75            * fast/dom/DOMImplementation/createDocument-namespace-err.html:
     76            * fast/dom/Document/createAttributeNS-namespace-err-expected.txt:
     77            * fast/dom/Document/createAttributeNS-namespace-err.html:
     78            * fast/dom/Document/createElement-invalid-names-expected.txt:
     79            * fast/dom/Document/createElement-invalid-names.html:
     80            * fast/dom/Document/createElementNS-namespace-err-expected.txt:
     81            * fast/dom/Document/createElementNS-namespace-err.html:
     82            * fast/dom/Element/setAttributeNS-namespace-err-expected.txt:
     83            * fast/dom/Element/setAttributeNS-namespace-err.html:
     84            * fast/dom/dataset-expected.txt:
     85            * fast/dom/dataset-xhtml-expected.txt:
     86            * fast/dom/dataset-xhtml.xhtml:
     87            * fast/dom/dataset.html:
     88            Update and rebaseline outdated WebKit tests.
     89
    1902022-01-24  Alan Coon  <alancoon@apple.com>
    291
  • branches/safari-613-branch/LayoutTests/dom/xhtml/level3/core/canonicalform06-expected.txt

    r65878 r288517  
    11Test    http://www.w3.org/2001/DOM-Test-Suite/level3/core/canonicalform06
    2 Status  Success
     2Status  failure
     3Message xml10InvalidName: assertTrue failed
  • branches/safari-613-branch/LayoutTests/dom/xhtml/level3/core/infoset06-expected.txt

    r65878 r288517  
    11Test    http://www.w3.org/2001/DOM-Test-Suite/level3/core/infoset06
    2 Status  Success
     2Status  failure
     3Message xml10InvalidName: assertTrue failed
  • branches/safari-613-branch/LayoutTests/dom/xhtml/level3/core/infoset07-expected.txt

    r65878 r288517  
    11Test    http://www.w3.org/2001/DOM-Test-Suite/level3/core/infoset07
    2 Status  Success
     2Status  failure
     3Message xml10InvalidName: assertTrue failed
  • branches/safari-613-branch/LayoutTests/dom/xhtml/level3/core/wellformed01-expected.txt

    r65878 r288517  
    11Test    http://www.w3.org/2001/DOM-Test-Suite/level3/core/wellformed01
    2 Status  Success
     2Status  failure
     3Message xml10InvalidName: assertTrue failed
  • branches/safari-613-branch/LayoutTests/dom/xhtml/level3/core/wellformed02-expected.txt

    r65878 r288517  
    11Test    http://www.w3.org/2001/DOM-Test-Suite/level3/core/wellformed02
    2 Status  Success
     2Status  failure
     3Message xml10InvalidName: assertTrue failed
  • branches/safari-613-branch/LayoutTests/dom/xhtml/level3/core/wellformed03-expected.txt

    r65878 r288517  
    11Test    http://www.w3.org/2001/DOM-Test-Suite/level3/core/wellformed03
    2 Status  Success
     2Status  failure
     3Message xml10InvalidName: assertTrue failed
  • branches/safari-613-branch/LayoutTests/dom/xhtml/level3/core/wellformed04-expected.txt

    r65878 r288517  
    11Test    http://www.w3.org/2001/DOM-Test-Suite/level3/core/wellformed04
    2 Status  Success
     2Status  failure
     3Message xml10InvalidName: assertTrue failed
  • branches/safari-613-branch/LayoutTests/fast/dom/DOMImplementation/createDocument-namespace-err-expected.txt

    r215701 r288517  
    3636PASS createDocument("http://example.com/", "0:a", null); 0 at start makes it not a valid XML name; threw INVALID_CHARACTER_ERR
    3737PASS createDocument("http://example.com/", "a:_", null)
    38 PASS createDocument("http://example.com/", "a:ெ", null); non-ASCII character after colon is CombiningChar, which is NCNameChar but not (Letter | "_") so invalid at start of NCName (but still a valid XML name, hence not INVALID_CHARACTER_ERR); threw INVALID_CHARACTER_ERR
    39 PASS createDocument("http://example.com/", "ெ:a", null); non-ASCII character after colon is CombiningChar, which is NCNameChar but not (Letter | "_") so invalid at start of NCName (Gecko chooses to throw NAMESPACE_ERR here, but either is valid as this is both an invalid XML name and an invalid QName); threw INVALID_CHARACTER_ERR
     38PASS createDocument("http://example.com/", "a:;", null); non-ASCII character after colon is CombiningChar, which is NCNameChar but not (Letter | "_") so invalid at start of NCName (but still a valid XML name, hence not INVALID_CHARACTER_ERR); threw INVALID_CHARACTER_ERR
     39PASS createDocument("http://example.com/", ";:a", null); non-ASCII character after colon is CombiningChar, which is NCNameChar but not (Letter | "_") so invalid at start of NCName (Gecko chooses to throw NAMESPACE_ERR here, but either is valid as this is both an invalid XML name and an invalid QName); threw INVALID_CHARACTER_ERR
    4040PASS createDocument("http://example.com/", "a:aெ", null)
    4141PASS createDocument("http://example.com/", "aெ:a", null)
  • branches/safari-613-branch/LayoutTests/fast/dom/DOMImplementation/createDocument-namespace-err.html

    r217390 r288517  
    7979   { args: ["http://example.com/", "0:a"], code: 5, message: "0 at start makes it not a valid XML name" },
    8080   { args: ["http://example.com/", "a:_"] },
    81    { args: ["http://example.com/", "a:\u0BC6"], code: 5,
     81   { args: ["http://example.com/", "a:\u037E"], code: 5,
    8282     message: "non-ASCII character after colon is CombiningChar, which is " +
    8383              "NCNameChar but not (Letter | \"_\") so invalid at start of " +
    8484              "NCName (but still a valid XML name, hence not INVALID_CHARACTER_ERR)" },
    85    { args: ["http://example.com/", "\u0BC6:a"], code: 5,
     85   { args: ["http://example.com/", "\u037E:a"], code: 5,
    8686     message: "non-ASCII character after colon is CombiningChar, which is " +
    8787              "NCNameChar but not (Letter | \"_\") so invalid at start of " +
  • branches/safari-613-branch/LayoutTests/fast/dom/Document/createAttributeNS-namespace-err-expected.txt

    r215701 r288517  
    3636PASS createAttributeNS("http://example.com/", "0:a"); 0 at start makes it not a valid XML name; threw INVALID_CHARACTER_ERR
    3737PASS createAttributeNS("http://example.com/", "a:_")
    38 FAIL createAttributeNS("http://example.com/", "a:ெ"); non-ASCII character after colon is CombiningChar, which is NCNameChar but not (Letter | "_") so invalid at start of NCName (but still a valid XML name, hence not INVALID_CHARACTER_ERR); expected NAMESPACE_ERR, threw INVALID_CHARACTER_ERR
    39 PASS createAttributeNS("http://example.com/", "ெ:a"); non-ASCII character after colon is CombiningChar, which is NCNameChar but not (Letter | "_") so invalid at start of NCName (Gecko chooses to throw NAMESPACE_ERR here, but either is valid as this is both an invalid XML name and an invalid QName); threw INVALID_CHARACTER_ERR
     38FAIL createAttributeNS("http://example.com/", "a:;"); non-ASCII character after colon is CombiningChar, which is NCNameChar but not (Letter | "_") so invalid at start of NCName (but still a valid XML name, hence not INVALID_CHARACTER_ERR); expected NAMESPACE_ERR, threw INVALID_CHARACTER_ERR
     39PASS createAttributeNS("http://example.com/", ";:a"); non-ASCII character after colon is CombiningChar, which is NCNameChar but not (Letter | "_") so invalid at start of NCName (Gecko chooses to throw NAMESPACE_ERR here, but either is valid as this is both an invalid XML name and an invalid QName); threw INVALID_CHARACTER_ERR
    4040PASS createAttributeNS("http://example.com/", "a:aெ")
    4141PASS createAttributeNS("http://example.com/", "aெ:a")
  • branches/safari-613-branch/LayoutTests/fast/dom/Document/createAttributeNS-namespace-err.html

    r217390 r288517  
    7373   { args: ["http://example.com/", "0:a"], code: 5, message: "0 at start makes it not a valid XML name" },
    7474   { args: ["http://example.com/", "a:_"] },
    75    { args: ["http://example.com/", "a:\u0BC6"], code: 14,
     75   { args: ["http://example.com/", "a:\u037E"], code: 14,
    7676     message: "non-ASCII character after colon is CombiningChar, which is " +
    7777              "NCNameChar but not (Letter | \"_\") so invalid at start of " +
    7878              "NCName (but still a valid XML name, hence not INVALID_CHARACTER_ERR)" },
    79    { args: ["http://example.com/", "\u0BC6:a"], code: 5,
     79   { args: ["http://example.com/", "\u037E:a"], code: 5,
    8080     message: "non-ASCII character after colon is CombiningChar, which is " +
    8181              "NCNameChar but not (Letter | \"_\") so invalid at start of " +
  • branches/safari-613-branch/LayoutTests/fast/dom/Document/createElement-invalid-names-expected.txt

    r219663 r288517  
    99PASS document.createElement(' ascii') threw exception InvalidCharacterError: The string contains invalid characters..
    1010PASS document.createElement('   ascii') threw exception InvalidCharacterError: The string contains invalid characters..
    11 PASS document.createElement('֑sc.ii') threw exception InvalidCharacterError: The string contains invalid characters..
    12 PASS document.createElement('⃣scii') threw exception InvalidCharacterError: The string contains invalid characters..
    13 PASS document.createElement('िascii') threw exception InvalidCharacterError: The string contains invalid characters..
    14 PASS document.createElement('ʳascii') threw exception InvalidCharacterError: The string contains invalid characters..
     11PASS document.createElement(';ascii') threw exception InvalidCharacterError: The string contains invalid characters..
    1512PASS document.createElement('asc i') threw exception InvalidCharacterError: The string contains invalid characters..
    1613PASS document.createElement('asc        i') threw exception InvalidCharacterError: The string contains invalid characters..
    17 PASS document.createElement('asciiⅦ') threw exception InvalidCharacterError: The string contains invalid characters..
    1814PASS successfullyParsed is true
    1915
  • branches/safari-613-branch/LayoutTests/fast/dom/Document/createElement-invalid-names.html

    r219663 r288517  
    1616                ' ascii',
    1717                '       ascii',
    18                 '֑sc.ii',
    19                 '⃣scii',
    20                 'िascii',
    21                 'ʳascii',
     18                '\u037Eascii',
    2219                // Invalid other char
    2320                'asc i',
    2421                'asc    i',
    25                 'asciiⅦ'
    2622                ];
    2723
  • branches/safari-613-branch/LayoutTests/fast/dom/Document/createElementNS-namespace-err-expected.txt

    r215701 r288517  
    3737PASS createElementNS("http://example.com/", "0:a"); 0 at start makes it not a valid XML name; threw INVALID_CHARACTER_ERR
    3838PASS createElementNS("http://example.com/", "a:_")
    39 FAIL createElementNS("http://example.com/", "a:ெ"); non-ASCII character after colon is CombiningChar, which is NCNameChar but not (Letter | "_") so invalid at start of NCName (but still a valid XML name, hence not INVALID_CHARACTER_ERR); expected NAMESPACE_ERR, threw INVALID_CHARACTER_ERR
    40 PASS createElementNS("http://example.com/", "ெ:a"); non-ASCII character after colon is CombiningChar, which is NCNameChar but not (Letter | "_") so invalid at start of NCName (Gecko chooses to throw NAMESPACE_ERR here, but either is valid as this is both an invalid XML name and an invalid QName); threw INVALID_CHARACTER_ERR
     39FAIL createElementNS("http://example.com/", "a:;"); non-ASCII character after colon is CombiningChar, which is NCNameChar but not (Letter | "_") so invalid at start of NCName (but still a valid XML name, hence not INVALID_CHARACTER_ERR); expected NAMESPACE_ERR, threw INVALID_CHARACTER_ERR
     40PASS createElementNS("http://example.com/", ";:a"); non-ASCII character after colon is CombiningChar, which is NCNameChar but not (Letter | "_") so invalid at start of NCName (Gecko chooses to throw NAMESPACE_ERR here, but either is valid as this is both an invalid XML name and an invalid QName); threw INVALID_CHARACTER_ERR
    4141PASS createElementNS("http://example.com/", "a:aெ")
    4242PASS createElementNS("http://example.com/", "aெ:a")
    … …  
    6767PASS createElement("a:_")
    6868PASS createElement("a:ெ"); non-ASCII character after colon is CombiningChar, which is valid in pre-namespace XML
    69 PASS createElement("ெ:a"); not a valid start character; threw INVALID_CHARACTER_ERR
     69PASS createElement(";:a"); not a valid start character; threw INVALID_CHARACTER_ERR
    7070PASS createElement("a:aெ")
    7171PASS createElement("aெ:a")
    … …  
    9696PASS createElement("a:_")
    9797PASS createElement("a:ெ"); non-ASCII character after colon is CombiningChar, which is valid in pre-namespace XML
    98 PASS createElement("ெ:a"); not a valid start character; threw INVALID_CHARACTER_ERR
     98PASS createElement(";:a"); not a valid start character; threw INVALID_CHARACTER_ERR
    9999PASS createElement("a:aெ")
    100100PASS createElement("aெ:a")
    … …  
    125125PASS createElement("a:_")
    126126PASS createElement("a:ெ"); non-ASCII character after colon is CombiningChar, which is valid in pre-namespace XML
    127 PASS createElement("ெ:a"); not a valid start character; threw INVALID_CHARACTER_ERR
     127PASS createElement(";:a"); not a valid start character; threw INVALID_CHARACTER_ERR
    128128PASS createElement("a:aெ")
    129129PASS createElement("aெ:a")
  • branches/safari-613-branch/LayoutTests/fast/dom/Document/createElementNS-namespace-err.html

    r217390 r288517  
    7373   { args: ["http://example.com/", "0:a"], code: 5, message: "0 at start makes it not a valid XML name" },
    7474   { args: ["http://example.com/", "a:_"] },
    75    { args: ["http://example.com/", "a:\u0BC6"], code: 14,
     75   { args: ["http://example.com/", "a:\u037E"], code: 14,
    7676     message: "non-ASCII character after colon is CombiningChar, which is " +
    7777              "NCNameChar but not (Letter | \"_\") so invalid at start of " +
    7878              "NCName (but still a valid XML name, hence not INVALID_CHARACTER_ERR)" },
    79    { args: ["http://example.com/", "\u0BC6:a"], code: 5,
     79   { args: ["http://example.com/", "\u037E:a"], code: 5,
    8080     message: "non-ASCII character after colon is CombiningChar, which is " +
    8181              "NCNameChar but not (Letter | \"_\") so invalid at start of " +
    … …  
    115115     message: "non-ASCII character after colon is CombiningChar, which is " +
    116116              "valid in pre-namespace XML" },
    117    { args: ["\u0BC6:a"], code: 5, message: "not a valid start character" },
     117   { args: ["\u037E:a"], code: 5, message: "not a valid start character" },
    118118   { args: ["a:a\u0BC6"] },
    119119   { args: ["a\u0BC6:a"] },
  • branches/safari-613-branch/LayoutTests/fast/dom/Element/setAttributeNS-namespace-err-expected.txt

    r215701 r288517  
    3737PASS element.setAttributeNS("http://example.com/", "0:a", 'value'); 0 at start makes it not a valid XML name; threw INVALID_CHARACTER_ERR
    3838PASS element.setAttributeNS("http://example.com/", "a:_", 'value')
    39 FAIL element.setAttributeNS("http://example.com/", "a:ெ", 'value'); non-ASCII character after colon is CombiningChar, which is NCNameChar but not (Letter | "_") so invalid at start of NCName (but still a valid XML name, hence not INVALID_CHARACTER_ERR); expected NAMESPACE_ERR, threw INVALID_CHARACTER_ERR
    40 PASS element.setAttributeNS("http://example.com/", "ெ:a", 'value'); non-ASCII character after colon is CombiningChar, which is NCNameChar but not (Letter | "_") so invalid at start of NCName (Gecko chooses to throw NAMESPACE_ERR here, but either is valid as this is both an invalid XML name and an invalid QName); threw INVALID_CHARACTER_ERR
     39FAIL element.setAttributeNS("http://example.com/", "a:;", 'value'); non-ASCII character after colon is CombiningChar, which is NCNameChar but not (Letter | "_") so invalid at start of NCName (but still a valid XML name, hence not INVALID_CHARACTER_ERR); expected NAMESPACE_ERR, threw INVALID_CHARACTER_ERR
     40PASS element.setAttributeNS("http://example.com/", ";:a", 'value'); non-ASCII character after colon is CombiningChar, which is NCNameChar but not (Letter | "_") so invalid at start of NCName (Gecko chooses to throw NAMESPACE_ERR here, but either is valid as this is both an invalid XML name and an invalid QName); threw INVALID_CHARACTER_ERR
    4141PASS element.setAttributeNS("http://example.com/", "a:aெ", 'value')
    4242PASS element.setAttributeNS("http://example.com/", "aெ:a", 'value')
  • branches/safari-613-branch/LayoutTests/fast/dom/Element/setAttributeNS-namespace-err.html

    r217390 r288517  
    7373   { args: ["http://example.com/", "0:a"], code: 5, message: "0 at start makes it not a valid XML name" },
    7474   { args: ["http://example.com/", "a:_"] },
    75    { args: ["http://example.com/", "a:\u0BC6"], code: 14,
     75   { args: ["http://example.com/", "a:\u037E"], code: 14,
    7676     message: "non-ASCII character after colon is CombiningChar, which is " +
    7777              "NCNameChar but not (Letter | \"_\") so invalid at start of " +
    7878              "NCName (but still a valid XML name, hence not INVALID_CHARACTER_ERR)" },
    79    { args: ["http://example.com/", "\u0BC6:a"], code: 5,
     79   { args: ["http://example.com/", "\u037E:a"], code: 5,
    8080     message: "non-ASCII character after colon is CombiningChar, which is " +
    8181              "NCNameChar but not (Letter | \"_\") so invalid at start of " +
  • branches/safari-613-branch/LayoutTests/fast/dom/dataset-expected.txt

    r219663 r288517  
    2727PASS testSet('', 'data-') is true
    2828PASS testSet('à', 'data-à') is true
     29PASS testSet('foo豈', 'data-foo豈') is true
    2930
    3031PASS testSet('-foo', 'dummy') threw exception SyntaxError: The string did not match the expected pattern..
    3132PASS testSet('foo ', 'dummy') threw exception InvalidCharacterError: The string contains invalid characters..
    32 PASS testSet('foo豈', 'dummy') threw exception InvalidCharacterError: The string contains invalid characters..
    3333
    3434PASS testDelete('data-foo', 'foo') is true
  • branches/safari-613-branch/LayoutTests/fast/dom/dataset-xhtml-expected.txt

    r219663 r288517  
    2222PASS testSet('', 'data-') is true
    2323PASS testSet('à', 'data-à') is true
     24PASS testSet('foo豈', 'data-foo豈') is true
    2425
    2526PASS testSet('-foo', 'dummy') threw exception SyntaxError: The string did not match the expected pattern..
    2627PASS testSet('foo ', 'dummy') threw exception InvalidCharacterError: The string contains invalid characters..
    27 PASS testSet('foo豈', 'dummy') threw exception InvalidCharacterError: The string contains invalid characters..
    2828
    2929PASS testDelete('data-foo', 'foo') is true
  • branches/safari-613-branch/LayoutTests/fast/dom/dataset-xhtml.xhtml

    r219663 r288517  
    5555shouldBeTrue("testSet('', 'data-')");
    5656shouldBeTrue("testSet('\xE0', 'data-\xE0')");
     57shouldBeTrue("testSet('foo\uF900', 'data-foo\uF900')");
    5758debug("");
    5859
    5960shouldThrowErrorName("testSet('-foo', 'dummy')", "SyntaxError");
    6061shouldThrowErrorName("testSet('foo\x20', 'dummy')", "InvalidCharacterError");
    61 shouldThrowErrorName("testSet('foo\uF900', 'dummy')", "InvalidCharacterError");
    6262debug("");
    6363
  • branches/safari-613-branch/LayoutTests/fast/dom/dataset.html

    r219663 r288517  
    5858shouldBeTrue("testSet('', 'data-')");
    5959shouldBeTrue("testSet('\xE0', 'data-\xE0')");
     60shouldBeTrue("testSet('foo\uF900', 'data-foo\uF900')");
    6061debug("");
    6162
    6263shouldThrowErrorName("testSet('-foo', 'dummy')", "SyntaxError");
    6364shouldThrowErrorName("testSet('foo\x20', 'dummy')", "InvalidCharacterError");
    64 shouldThrowErrorName("testSet('foo\uF900', 'dummy')", "InvalidCharacterError");
    6565debug("");
    6666
  • branches/safari-613-branch/LayoutTests/imported/w3c/ChangeLog

    r288512 r288517  
     12022-01-24  Alan Coon  <alancoon@apple.com>
     2
     3        Cherry-pick r288264. rdar://problem/87745419
     4
     5    Align our qualified name validation with the specification
     6    https://bugs.webkit.org/show_bug.cgi?id=201699
     7   
     8    Reviewed by Geoffrey Garen.
     9   
     10    LayoutTests/imported/w3c:
     11   
     12    * web-platform-tests/dom/nodes/DOMImplementation-createDocument-expected.txt:
     13    * web-platform-tests/dom/nodes/Document-createElementNS-expected.txt:
     14    Rebaseline WPT tests now that more checks are passing.
     15   
     16    Source/WebCore:
     17   
     18    Align our qualified name validation with the latest specification:
     19    - https://dom.spec.whatwg.org/#validate
     20    - https://www.w3.org/TR/xml/#NT-NameStartChar
     21   
     22    No new tests, rebaselined existing tests.
     23   
     24    * dom/Document.cpp:
     25    (WebCore::isValidNameStart):
     26    (WebCore::isValidNamePart):
     27   
     28    LayoutTests:
     29   
     30    * dom/xhtml/level3/core/canonicalform06-expected.txt:
     31    * dom/xhtml/level3/core/infoset06-expected.txt:
     32    * dom/xhtml/level3/core/infoset07-expected.txt:
     33    * dom/xhtml/level3/core/wellformed01-expected.txt:
     34    * dom/xhtml/level3/core/wellformed02-expected.txt:
     35    * dom/xhtml/level3/core/wellformed03-expected.txt:
     36    * dom/xhtml/level3/core/wellformed04-expected.txt:
     37    Rebaseline outdated imported tests.
     38   
     39    * fast/dom/DOMImplementation/createDocument-namespace-err-expected.txt:
     40    * fast/dom/DOMImplementation/createDocument-namespace-err.html:
     41    * fast/dom/Document/createAttributeNS-namespace-err-expected.txt:
     42    * fast/dom/Document/createAttributeNS-namespace-err.html:
     43    * fast/dom/Document/createElement-invalid-names-expected.txt:
     44    * fast/dom/Document/createElement-invalid-names.html:
     45    * fast/dom/Document/createElementNS-namespace-err-expected.txt:
     46    * fast/dom/Document/createElementNS-namespace-err.html:
     47    * fast/dom/Element/setAttributeNS-namespace-err-expected.txt:
     48    * fast/dom/Element/setAttributeNS-namespace-err.html:
     49    * fast/dom/dataset-expected.txt:
     50    * fast/dom/dataset-xhtml-expected.txt:
     51    * fast/dom/dataset-xhtml.xhtml:
     52    * fast/dom/dataset.html:
     53    Update and rebaseline outdated WebKit tests.
     54   
     55   
     56    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288264 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     57
     58    2022-01-19  Chris Dumez  <cdumez@apple.com>
     59
     60            Align our qualified name validation with the specification
     61            https://bugs.webkit.org/show_bug.cgi?id=201699
     62
     63            Reviewed by Geoffrey Garen.
     64
     65            * web-platform-tests/dom/nodes/DOMImplementation-createDocument-expected.txt:
     66            * web-platform-tests/dom/nodes/Document-createElementNS-expected.txt:
     67            Rebaseline WPT tests now that more checks are passing.
     68
    1692022-01-24  Alan Coon  <alancoon@apple.com>
    270
  • branches/safari-613-branch/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/DOMImplementation-createDocument-expected.txt

    r267660 r288517  
    1717PASS createDocument test: metadata for null,"foo1",null
    1818PASS createDocument test: characterSet aliases for null,"foo1",null
    19 FAIL createDocument test: null,"ெfoo",null,null The string contains invalid characters.
    20 FAIL createDocument test: metadata for null,"ெfoo",null The string contains invalid characters.
    21 FAIL createDocument test: characterSet aliases for null,"ெfoo",null The string contains invalid characters.
     19PASS createDocument test: null,"ெfoo",null,null
     20PASS createDocument test: metadata for null,"ெfoo",null
     21PASS createDocument test: characterSet aliases for null,"ெfoo",null
    2222PASS createDocument test: null,";foo",null,"INVALID_CHARACTER_ERR"
    2323PASS createDocument test: null,"}foo",null,"INVALID_CHARACTER_ERR"
    … …  
    113113PASS createDocument test: metadata for "http://example.com/","a:_",null
    114114PASS createDocument test: characterSet aliases for "http://example.com/","a:_",null
    115 FAIL createDocument test: "http://example.com/","a:ெ",null,null The string contains invalid characters.
    116 FAIL createDocument test: metadata for "http://example.com/","a:ெ",null The string contains invalid characters.
    117 FAIL createDocument test: characterSet aliases for "http://example.com/","a:ெ",null The string contains invalid characters.
     115PASS createDocument test: "http://example.com/","a:ெ",null,null
     116PASS createDocument test: metadata for "http://example.com/","a:ெ",null
     117PASS createDocument test: characterSet aliases for "http://example.com/","a:ெ",null
    118118PASS createDocument test: "http://example.com/","a:;",null,"INVALID_CHARACTER_ERR"
    119119PASS createDocument test: "http://example.com/","a:̀",null,"INVALID_CHARACTER_ERR"
    120 FAIL createDocument test: "http://example.com/","ெ:a",null,null The string contains invalid characters.
    121 FAIL createDocument test: metadata for "http://example.com/","ெ:a",null The string contains invalid characters.
    122 FAIL createDocument test: characterSet aliases for "http://example.com/","ெ:a",null The string contains invalid characters.
     120PASS createDocument test: "http://example.com/","ெ:a",null,null
     121PASS createDocument test: metadata for "http://example.com/","ெ:a",null
     122PASS createDocument test: characterSet aliases for "http://example.com/","ெ:a",null
    123123PASS createDocument test: "http://example.com/","̀:a",null,"INVALID_CHARACTER_ERR"
    124124PASS createDocument test: "http://example.com/",";:a",null,"INVALID_CHARACTER_ERR"
  • branches/safari-613-branch/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Document-createElementNS-expected.txt

    r267660 r288517  
    1818PASS createElementNS test in XML document: null,"foo1",null
    1919PASS createElementNS test in XHTML document: null,"foo1",null
    20 FAIL createElementNS test in HTML document: null,"ெfoo",null The string contains invalid characters.
    21 FAIL createElementNS test in XML document: null,"ெfoo",null The string contains invalid characters.
    22 FAIL createElementNS test in XHTML document: null,"ெfoo",null The string contains invalid characters.
     20PASS createElementNS test in HTML document: null,"ெfoo",null
     21PASS createElementNS test in XML document: null,"ெfoo",null
     22PASS createElementNS test in XHTML document: null,"ெfoo",null
    2323PASS createElementNS test in HTML document: null,";foo","INVALID_CHARACTER_ERR"
    2424PASS createElementNS test in XML document: null,";foo","INVALID_CHARACTER_ERR"
    … …  
    210210PASS createElementNS test in XML document: "http://example.com/","a:_",null
    211211PASS createElementNS test in XHTML document: "http://example.com/","a:_",null
    212 FAIL createElementNS test in HTML document: "http://example.com/","a:ெ",null The string contains invalid characters.
    213 FAIL createElementNS test in XML document: "http://example.com/","a:ெ",null The string contains invalid characters.
    214 FAIL createElementNS test in XHTML document: "http://example.com/","a:ெ",null The string contains invalid characters.
     212PASS createElementNS test in HTML document: "http://example.com/","a:ெ",null
     213PASS createElementNS test in XML document: "http://example.com/","a:ெ",null
     214PASS createElementNS test in XHTML document: "http://example.com/","a:ெ",null
    215215PASS createElementNS test in HTML document: "http://example.com/","a:;","INVALID_CHARACTER_ERR"
    216216PASS createElementNS test in XML document: "http://example.com/","a:;","INVALID_CHARACTER_ERR"
    … …  
    219219PASS createElementNS test in XML document: "http://example.com/","a:̀","INVALID_CHARACTER_ERR"
    220220PASS createElementNS test in XHTML document: "http://example.com/","a:̀","INVALID_CHARACTER_ERR"
    221 FAIL createElementNS test in HTML document: "http://example.com/","ெ:a",null The string contains invalid characters.
    222 FAIL createElementNS test in XML document: "http://example.com/","ெ:a",null The string contains invalid characters.
    223 FAIL createElementNS test in XHTML document: "http://example.com/","ெ:a",null The string contains invalid characters.
     221PASS createElementNS test in HTML document: "http://example.com/","ெ:a",null
     222PASS createElementNS test in XML document: "http://example.com/","ெ:a",null
     223PASS createElementNS test in XHTML document: "http://example.com/","ெ:a",null
    224224PASS createElementNS test in HTML document: "http://example.com/","̀:a","INVALID_CHARACTER_ERR"
    225225PASS createElementNS test in XML document: "http://example.com/","̀:a","INVALID_CHARACTER_ERR"
  • branches/safari-613-branch/Source/WebCore/ChangeLog

    r288516 r288517  
     12022-01-24  Alan Coon  <alancoon@apple.com>
     2
     3        Cherry-pick r288264. rdar://problem/87745419
     4
     5    Align our qualified name validation with the specification
     6    https://bugs.webkit.org/show_bug.cgi?id=201699
     7   
     8    Reviewed by Geoffrey Garen.
     9   
     10    LayoutTests/imported/w3c:
     11   
     12    * web-platform-tests/dom/nodes/DOMImplementation-createDocument-expected.txt:
     13    * web-platform-tests/dom/nodes/Document-createElementNS-expected.txt:
     14    Rebaseline WPT tests now that more checks are passing.
     15   
     16    Source/WebCore:
     17   
     18    Align our qualified name validation with the latest specification:
     19    - https://dom.spec.whatwg.org/#validate
     20    - https://www.w3.org/TR/xml/#NT-NameStartChar
     21   
     22    No new tests, rebaselined existing tests.
     23   
     24    * dom/Document.cpp:
     25    (WebCore::isValidNameStart):
     26    (WebCore::isValidNamePart):
     27   
     28    LayoutTests:
     29   
     30    * dom/xhtml/level3/core/canonicalform06-expected.txt:
     31    * dom/xhtml/level3/core/infoset06-expected.txt:
     32    * dom/xhtml/level3/core/infoset07-expected.txt:
     33    * dom/xhtml/level3/core/wellformed01-expected.txt:
     34    * dom/xhtml/level3/core/wellformed02-expected.txt:
     35    * dom/xhtml/level3/core/wellformed03-expected.txt:
     36    * dom/xhtml/level3/core/wellformed04-expected.txt:
     37    Rebaseline outdated imported tests.
     38   
     39    * fast/dom/DOMImplementation/createDocument-namespace-err-expected.txt:
     40    * fast/dom/DOMImplementation/createDocument-namespace-err.html:
     41    * fast/dom/Document/createAttributeNS-namespace-err-expected.txt:
     42    * fast/dom/Document/createAttributeNS-namespace-err.html:
     43    * fast/dom/Document/createElement-invalid-names-expected.txt:
     44    * fast/dom/Document/createElement-invalid-names.html:
     45    * fast/dom/Document/createElementNS-namespace-err-expected.txt:
     46    * fast/dom/Document/createElementNS-namespace-err.html:
     47    * fast/dom/Element/setAttributeNS-namespace-err-expected.txt:
     48    * fast/dom/Element/setAttributeNS-namespace-err.html:
     49    * fast/dom/dataset-expected.txt:
     50    * fast/dom/dataset-xhtml-expected.txt:
     51    * fast/dom/dataset-xhtml.xhtml:
     52    * fast/dom/dataset.html:
     53    Update and rebaseline outdated WebKit tests.
     54   
     55   
     56    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288264 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     57
     58    2022-01-19  Chris Dumez  <cdumez@apple.com>
     59
     60            Align our qualified name validation with the specification
     61            https://bugs.webkit.org/show_bug.cgi?id=201699
     62
     63            Reviewed by Geoffrey Garen.
     64
     65            Align our qualified name validation with the latest specification:
     66            - https://dom.spec.whatwg.org/#validate
     67            - https://www.w3.org/TR/xml/#NT-NameStartChar
     68
     69            No new tests, rebaselined existing tests.
     70
     71            * dom/Document.cpp:
     72            (WebCore::isValidNameStart):
     73            (WebCore::isValidNamePart):
     74
    1752022-01-24  Alan Coon  <alancoon@apple.com>
    276
  • branches/safari-613-branch/Source/WebCore/dom/Document.cpp

    r287818 r288517  
    398398static const Seconds intersectionObserversInitialUpdateDelay { 2000_ms };
    399399
    400 // DOM Level 2 says (letters added):
    401 //
    402 // a) Name start characters must have one of the categories Ll, Lu, Lo, Lt, Nl.
    403 // b) Name characters other than Name-start characters must have one of the categories Mc, Me, Mn, Lm, or Nd.
    404 // c) Characters in the compatibility area (i.e. with character code greater than #xF900 and less than #xFFFE) are not allowed in XML names.
    405 // d) Characters which have a font or compatibility decomposition (i.e. those with a "compatibility formatting tag" in field 5 of the database -- marked by field 5 beginning with a "<") are not allowed.
    406 // e) The following characters are treated as name-start characters rather than name characters, because the property file classifies them as Alphabetic: [#x02BB-#x02C1], #x0559, #x06E5, #x06E6.
    407 // f) Characters #x20DD-#x20E0 are excluded (in accordance with Unicode, section 5.14).
    408 // g) Character #x00B7 is classified as an extender, because the property list so identifies it.
    409 // h) Character #x0387 is added as a name character, because #x00B7 is its canonical equivalent.
    410 // i) Characters ':' and '_' are allowed as name-start characters.
    411 // j) Characters '-' and '.' are allowed as name characters.
    412 //
    413 // It also contains complete tables. If we decide it's better, we could include those instead of the following code.
    414 
     400// https://www.w3.org/TR/xml/#NT-NameStartChar
     401// NameStartChar       ::=       ":" | [A-Z] | "_" | [a-z] | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x2FF] | [#x370-#x37D] | [#x37F-#x1FFF] | [#x200C-#x200D] | [#x2070-#x218F] | [#x2C00-#x2FEF] | [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]
    415402static inline bool isValidNameStart(UChar32 c)
    416403{
    417     // rule (e) above
    418     if ((c >= 0x02BB && c <= 0x02C1) || c == 0x559 || c == 0x6E5 || c == 0x6E6)
    419         return true;
    420 
    421     // rule (i) above
    422     if (c == ':' || c == '_')
    423         return true;
    424 
    425     // rules (a) and (f) above
    426     if (!(U_GET_GC_MASK(c) & (U_GC_LL_MASK | U_GC_LU_MASK | U_GC_LO_MASK | U_GC_LT_MASK | U_GC_NL_MASK)))
    427         return false;
    428 
    429     // rule (c) above
    430     if (c >= 0xF900 && c < 0xFFFE)
    431         return false;
    432 
    433     // rule (d) above
    434     int type = u_getIntPropertyValue(c, UCHAR_DECOMPOSITION_TYPE);
    435     if (type == U_DT_FONT || type == U_DT_COMPAT)
    436         return false;
    437 
    438     return true;
    439 }
    440 
     404    return c == ':' || (c >= 'A' && c <= 'Z') || c == '_' || (c >= 'a' && c <= 'z') || (c >= 0x00C0 && c <= 0x00D6)
     405        || (c >= 0x00D8 && c <= 0x00F6) || (c >= 0x00F8 && c <= 0x02FF) || (c >= 0x0370 && c <= 0x037D) || (c >= 0x037F && c <= 0x1FFF)
     406        || (c >= 0x200C && c <= 0x200D) || (c >= 0x2070 && c <= 0x218F) || (c >= 0x2C00 && c <= 0x2FeF) || (c >= 0x3001 && c <= 0xD7FF)
     407        || (c >= 0xF900 && c <= 0xFDCF) || (c >= 0xFDF0 && c <= 0xFFFD) || (c >= 0x10000 && c <= 0xEFFFF);
     408}
     409
     410// https://www.w3.org/TR/xml/#NT-NameChar
     411// NameChar       ::=       NameStartChar | "-" | "." | [0-9] | #xB7 | [#x0300-#x036F] | [#x203F-#x2040]
    441412static inline bool isValidNamePart(UChar32 c)
    442413{
    443     // rules (a), (e), and (i) above
    444     if (isValidNameStart(c))
    445         return true;
    446 
    447     // rules (g) and (h) above
    448     if (c == 0x00B7 || c == 0x0387)
    449         return true;
    450 
    451     // rule (j) above
    452     if (c == '-' || c == '.')
    453         return true;
    454 
    455     // rules (b) and (f) above
    456     if (!(U_GET_GC_MASK(c) & (U_GC_M_MASK | U_GC_LM_MASK | U_GC_ND_MASK)))
    457         return false;
    458 
    459     // rule (c) above
    460     if (c >= 0xF900 && c < 0xFFFE)
    461         return false;
    462 
    463     // rule (d) above
    464     int type = u_getIntPropertyValue(c, UCHAR_DECOMPOSITION_TYPE);
    465     if (type == U_DT_FONT || type == U_DT_COMPAT)
    466         return false;
    467 
    468     return true;
     414    return isValidNameStart(c) || c == '-' || c == '.' || (c >= '0' && c <= '9') || c == 0x00B7
     415        || (c >= 0x0300 && c <= 0x036F) || (c >= 0x203F && c <= 0x2040);
    469416}
    470417
Note: See TracChangeset for help on using the changeset viewer.