Changeset 288517 in webkit
- Timestamp:
- Jan 24, 2022, 5:56:06 PM (5 years ago)
- Location:
- branches/safari-613-branch
- Files:
-
- 27 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/dom/xhtml/level3/core/canonicalform06-expected.txt (modified) (1 diff)
-
LayoutTests/dom/xhtml/level3/core/infoset06-expected.txt (modified) (1 diff)
-
LayoutTests/dom/xhtml/level3/core/infoset07-expected.txt (modified) (1 diff)
-
LayoutTests/dom/xhtml/level3/core/wellformed01-expected.txt (modified) (1 diff)
-
LayoutTests/dom/xhtml/level3/core/wellformed02-expected.txt (modified) (1 diff)
-
LayoutTests/dom/xhtml/level3/core/wellformed03-expected.txt (modified) (1 diff)
-
LayoutTests/dom/xhtml/level3/core/wellformed04-expected.txt (modified) (1 diff)
-
LayoutTests/fast/dom/DOMImplementation/createDocument-namespace-err-expected.txt (modified) (1 diff)
-
LayoutTests/fast/dom/DOMImplementation/createDocument-namespace-err.html (modified) (1 diff)
-
LayoutTests/fast/dom/Document/createAttributeNS-namespace-err-expected.txt (modified) (1 diff)
-
LayoutTests/fast/dom/Document/createAttributeNS-namespace-err.html (modified) (1 diff)
-
LayoutTests/fast/dom/Document/createElement-invalid-names-expected.txt (modified) (1 diff)
-
LayoutTests/fast/dom/Document/createElement-invalid-names.html (modified) (1 diff)
-
LayoutTests/fast/dom/Document/createElementNS-namespace-err-expected.txt (modified) (4 diffs)
-
LayoutTests/fast/dom/Document/createElementNS-namespace-err.html (modified) (2 diffs)
-
LayoutTests/fast/dom/Element/setAttributeNS-namespace-err-expected.txt (modified) (1 diff)
-
LayoutTests/fast/dom/Element/setAttributeNS-namespace-err.html (modified) (1 diff)
-
LayoutTests/fast/dom/dataset-expected.txt (modified) (1 diff)
-
LayoutTests/fast/dom/dataset-xhtml-expected.txt (modified) (1 diff)
-
LayoutTests/fast/dom/dataset-xhtml.xhtml (modified) (1 diff)
-
LayoutTests/fast/dom/dataset.html (modified) (1 diff)
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/dom/nodes/DOMImplementation-createDocument-expected.txt (modified) (2 diffs)
-
LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Document-createElementNS-expected.txt (modified) (3 diffs)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/dom/Document.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-613-branch/LayoutTests/ChangeLog
r288516 r288517 1 2022-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 1 90 2022-01-24 Alan Coon <alancoon@apple.com> 2 91 -
branches/safari-613-branch/LayoutTests/dom/xhtml/level3/core/canonicalform06-expected.txt
r65878 r288517 1 1 Test http://www.w3.org/2001/DOM-Test-Suite/level3/core/canonicalform06 2 Status Success 2 Status failure 3 Message xml10InvalidName: assertTrue failed -
branches/safari-613-branch/LayoutTests/dom/xhtml/level3/core/infoset06-expected.txt
r65878 r288517 1 1 Test http://www.w3.org/2001/DOM-Test-Suite/level3/core/infoset06 2 Status Success 2 Status failure 3 Message xml10InvalidName: assertTrue failed -
branches/safari-613-branch/LayoutTests/dom/xhtml/level3/core/infoset07-expected.txt
r65878 r288517 1 1 Test http://www.w3.org/2001/DOM-Test-Suite/level3/core/infoset07 2 Status Success 2 Status failure 3 Message xml10InvalidName: assertTrue failed -
branches/safari-613-branch/LayoutTests/dom/xhtml/level3/core/wellformed01-expected.txt
r65878 r288517 1 1 Test http://www.w3.org/2001/DOM-Test-Suite/level3/core/wellformed01 2 Status Success 2 Status failure 3 Message xml10InvalidName: assertTrue failed -
branches/safari-613-branch/LayoutTests/dom/xhtml/level3/core/wellformed02-expected.txt
r65878 r288517 1 1 Test http://www.w3.org/2001/DOM-Test-Suite/level3/core/wellformed02 2 Status Success 2 Status failure 3 Message xml10InvalidName: assertTrue failed -
branches/safari-613-branch/LayoutTests/dom/xhtml/level3/core/wellformed03-expected.txt
r65878 r288517 1 1 Test http://www.w3.org/2001/DOM-Test-Suite/level3/core/wellformed03 2 Status Success 2 Status failure 3 Message xml10InvalidName: assertTrue failed -
branches/safari-613-branch/LayoutTests/dom/xhtml/level3/core/wellformed04-expected.txt
r65878 r288517 1 1 Test http://www.w3.org/2001/DOM-Test-Suite/level3/core/wellformed04 2 Status Success 2 Status failure 3 Message xml10InvalidName: assertTrue failed -
branches/safari-613-branch/LayoutTests/fast/dom/DOMImplementation/createDocument-namespace-err-expected.txt
r215701 r288517 36 36 PASS createDocument("http://example.com/", "0:a", null); 0 at start makes it not a valid XML name; threw INVALID_CHARACTER_ERR 37 37 PASS 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_ERR39 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_ERR38 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 40 40 PASS createDocument("http://example.com/", "a:aெ", null) 41 41 PASS createDocument("http://example.com/", "aெ:a", null) -
branches/safari-613-branch/LayoutTests/fast/dom/DOMImplementation/createDocument-namespace-err.html
r217390 r288517 79 79 { args: ["http://example.com/", "0:a"], code: 5, message: "0 at start makes it not a valid XML name" }, 80 80 { args: ["http://example.com/", "a:_"] }, 81 { args: ["http://example.com/", "a:\u0 BC6"], code: 5,81 { args: ["http://example.com/", "a:\u037E"], code: 5, 82 82 message: "non-ASCII character after colon is CombiningChar, which is " + 83 83 "NCNameChar but not (Letter | \"_\") so invalid at start of " + 84 84 "NCName (but still a valid XML name, hence not INVALID_CHARACTER_ERR)" }, 85 { args: ["http://example.com/", "\u0 BC6:a"], code: 5,85 { args: ["http://example.com/", "\u037E:a"], code: 5, 86 86 message: "non-ASCII character after colon is CombiningChar, which is " + 87 87 "NCNameChar but not (Letter | \"_\") so invalid at start of " + -
branches/safari-613-branch/LayoutTests/fast/dom/Document/createAttributeNS-namespace-err-expected.txt
r215701 r288517 36 36 PASS createAttributeNS("http://example.com/", "0:a"); 0 at start makes it not a valid XML name; threw INVALID_CHARACTER_ERR 37 37 PASS 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_ERR39 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_ERR38 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 40 40 PASS createAttributeNS("http://example.com/", "a:aெ") 41 41 PASS createAttributeNS("http://example.com/", "aெ:a") -
branches/safari-613-branch/LayoutTests/fast/dom/Document/createAttributeNS-namespace-err.html
r217390 r288517 73 73 { args: ["http://example.com/", "0:a"], code: 5, message: "0 at start makes it not a valid XML name" }, 74 74 { args: ["http://example.com/", "a:_"] }, 75 { args: ["http://example.com/", "a:\u0 BC6"], code: 14,75 { args: ["http://example.com/", "a:\u037E"], code: 14, 76 76 message: "non-ASCII character after colon is CombiningChar, which is " + 77 77 "NCNameChar but not (Letter | \"_\") so invalid at start of " + 78 78 "NCName (but still a valid XML name, hence not INVALID_CHARACTER_ERR)" }, 79 { args: ["http://example.com/", "\u0 BC6:a"], code: 5,79 { args: ["http://example.com/", "\u037E:a"], code: 5, 80 80 message: "non-ASCII character after colon is CombiningChar, which is " + 81 81 "NCNameChar but not (Letter | \"_\") so invalid at start of " + -
branches/safari-613-branch/LayoutTests/fast/dom/Document/createElement-invalid-names-expected.txt
r219663 r288517 9 9 PASS document.createElement(' ascii') threw exception InvalidCharacterError: The string contains invalid characters.. 10 10 PASS 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.. 11 PASS document.createElement(';ascii') threw exception InvalidCharacterError: The string contains invalid characters.. 15 12 PASS document.createElement('asc i') threw exception InvalidCharacterError: The string contains invalid characters.. 16 13 PASS 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..18 14 PASS successfullyParsed is true 19 15 -
branches/safari-613-branch/LayoutTests/fast/dom/Document/createElement-invalid-names.html
r219663 r288517 16 16 ' ascii', 17 17 ' ascii', 18 '֑sc.ii', 19 '⃣scii', 20 'िascii', 21 'ʳascii', 18 '\u037Eascii', 22 19 // Invalid other char 23 20 'asc i', 24 21 'asc i', 25 'asciiⅦ'26 22 ]; 27 23 -
branches/safari-613-branch/LayoutTests/fast/dom/Document/createElementNS-namespace-err-expected.txt
r215701 r288517 37 37 PASS createElementNS("http://example.com/", "0:a"); 0 at start makes it not a valid XML name; threw INVALID_CHARACTER_ERR 38 38 PASS 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_ERR40 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_ERR39 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 41 41 PASS createElementNS("http://example.com/", "a:aெ") 42 42 PASS createElementNS("http://example.com/", "aெ:a") … … 67 67 PASS createElement("a:_") 68 68 PASS 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_ERR69 PASS createElement(";:a"); not a valid start character; threw INVALID_CHARACTER_ERR 70 70 PASS createElement("a:aெ") 71 71 PASS createElement("aெ:a") … … 96 96 PASS createElement("a:_") 97 97 PASS 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_ERR98 PASS createElement(";:a"); not a valid start character; threw INVALID_CHARACTER_ERR 99 99 PASS createElement("a:aெ") 100 100 PASS createElement("aெ:a") … … 125 125 PASS createElement("a:_") 126 126 PASS 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_ERR127 PASS createElement(";:a"); not a valid start character; threw INVALID_CHARACTER_ERR 128 128 PASS createElement("a:aெ") 129 129 PASS createElement("aெ:a") -
branches/safari-613-branch/LayoutTests/fast/dom/Document/createElementNS-namespace-err.html
r217390 r288517 73 73 { args: ["http://example.com/", "0:a"], code: 5, message: "0 at start makes it not a valid XML name" }, 74 74 { args: ["http://example.com/", "a:_"] }, 75 { args: ["http://example.com/", "a:\u0 BC6"], code: 14,75 { args: ["http://example.com/", "a:\u037E"], code: 14, 76 76 message: "non-ASCII character after colon is CombiningChar, which is " + 77 77 "NCNameChar but not (Letter | \"_\") so invalid at start of " + 78 78 "NCName (but still a valid XML name, hence not INVALID_CHARACTER_ERR)" }, 79 { args: ["http://example.com/", "\u0 BC6:a"], code: 5,79 { args: ["http://example.com/", "\u037E:a"], code: 5, 80 80 message: "non-ASCII character after colon is CombiningChar, which is " + 81 81 "NCNameChar but not (Letter | \"_\") so invalid at start of " + … … 115 115 message: "non-ASCII character after colon is CombiningChar, which is " + 116 116 "valid in pre-namespace XML" }, 117 { args: ["\u0 BC6:a"], code: 5, message: "not a valid start character" },117 { args: ["\u037E:a"], code: 5, message: "not a valid start character" }, 118 118 { args: ["a:a\u0BC6"] }, 119 119 { args: ["a\u0BC6:a"] }, -
branches/safari-613-branch/LayoutTests/fast/dom/Element/setAttributeNS-namespace-err-expected.txt
r215701 r288517 37 37 PASS element.setAttributeNS("http://example.com/", "0:a", 'value'); 0 at start makes it not a valid XML name; threw INVALID_CHARACTER_ERR 38 38 PASS 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_ERR40 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_ERR39 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 41 41 PASS element.setAttributeNS("http://example.com/", "a:aெ", 'value') 42 42 PASS element.setAttributeNS("http://example.com/", "aெ:a", 'value') -
branches/safari-613-branch/LayoutTests/fast/dom/Element/setAttributeNS-namespace-err.html
r217390 r288517 73 73 { args: ["http://example.com/", "0:a"], code: 5, message: "0 at start makes it not a valid XML name" }, 74 74 { args: ["http://example.com/", "a:_"] }, 75 { args: ["http://example.com/", "a:\u0 BC6"], code: 14,75 { args: ["http://example.com/", "a:\u037E"], code: 14, 76 76 message: "non-ASCII character after colon is CombiningChar, which is " + 77 77 "NCNameChar but not (Letter | \"_\") so invalid at start of " + 78 78 "NCName (but still a valid XML name, hence not INVALID_CHARACTER_ERR)" }, 79 { args: ["http://example.com/", "\u0 BC6:a"], code: 5,79 { args: ["http://example.com/", "\u037E:a"], code: 5, 80 80 message: "non-ASCII character after colon is CombiningChar, which is " + 81 81 "NCNameChar but not (Letter | \"_\") so invalid at start of " + -
branches/safari-613-branch/LayoutTests/fast/dom/dataset-expected.txt
r219663 r288517 27 27 PASS testSet('', 'data-') is true 28 28 PASS testSet('à', 'data-à') is true 29 PASS testSet('foo豈', 'data-foo豈') is true 29 30 30 31 PASS testSet('-foo', 'dummy') threw exception SyntaxError: The string did not match the expected pattern.. 31 32 PASS testSet('foo ', 'dummy') threw exception InvalidCharacterError: The string contains invalid characters.. 32 PASS testSet('foo豈', 'dummy') threw exception InvalidCharacterError: The string contains invalid characters..33 33 34 34 PASS testDelete('data-foo', 'foo') is true -
branches/safari-613-branch/LayoutTests/fast/dom/dataset-xhtml-expected.txt
r219663 r288517 22 22 PASS testSet('', 'data-') is true 23 23 PASS testSet('à', 'data-à') is true 24 PASS testSet('foo豈', 'data-foo豈') is true 24 25 25 26 PASS testSet('-foo', 'dummy') threw exception SyntaxError: The string did not match the expected pattern.. 26 27 PASS testSet('foo ', 'dummy') threw exception InvalidCharacterError: The string contains invalid characters.. 27 PASS testSet('foo豈', 'dummy') threw exception InvalidCharacterError: The string contains invalid characters..28 28 29 29 PASS testDelete('data-foo', 'foo') is true -
branches/safari-613-branch/LayoutTests/fast/dom/dataset-xhtml.xhtml
r219663 r288517 55 55 shouldBeTrue("testSet('', 'data-')"); 56 56 shouldBeTrue("testSet('\xE0', 'data-\xE0')"); 57 shouldBeTrue("testSet('foo\uF900', 'data-foo\uF900')"); 57 58 debug(""); 58 59 59 60 shouldThrowErrorName("testSet('-foo', 'dummy')", "SyntaxError"); 60 61 shouldThrowErrorName("testSet('foo\x20', 'dummy')", "InvalidCharacterError"); 61 shouldThrowErrorName("testSet('foo\uF900', 'dummy')", "InvalidCharacterError");62 62 debug(""); 63 63 -
branches/safari-613-branch/LayoutTests/fast/dom/dataset.html
r219663 r288517 58 58 shouldBeTrue("testSet('', 'data-')"); 59 59 shouldBeTrue("testSet('\xE0', 'data-\xE0')"); 60 shouldBeTrue("testSet('foo\uF900', 'data-foo\uF900')"); 60 61 debug(""); 61 62 62 63 shouldThrowErrorName("testSet('-foo', 'dummy')", "SyntaxError"); 63 64 shouldThrowErrorName("testSet('foo\x20', 'dummy')", "InvalidCharacterError"); 64 shouldThrowErrorName("testSet('foo\uF900', 'dummy')", "InvalidCharacterError");65 65 debug(""); 66 66 -
branches/safari-613-branch/LayoutTests/imported/w3c/ChangeLog
r288512 r288517 1 2022-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 1 69 2022-01-24 Alan Coon <alancoon@apple.com> 2 70 -
branches/safari-613-branch/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/DOMImplementation-createDocument-expected.txt
r267660 r288517 17 17 PASS createDocument test: metadata for null,"foo1",null 18 18 PASS 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. 19 PASS createDocument test: null,"ெfoo",null,null 20 PASS createDocument test: metadata for null,"ெfoo",null 21 PASS createDocument test: characterSet aliases for null,"ெfoo",null 22 22 PASS createDocument test: null,";foo",null,"INVALID_CHARACTER_ERR" 23 23 PASS createDocument test: null,"}foo",null,"INVALID_CHARACTER_ERR" … … 113 113 PASS createDocument test: metadata for "http://example.com/","a:_",null 114 114 PASS 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. 115 PASS createDocument test: "http://example.com/","a:ெ",null,null 116 PASS createDocument test: metadata for "http://example.com/","a:ெ",null 117 PASS createDocument test: characterSet aliases for "http://example.com/","a:ெ",null 118 118 PASS createDocument test: "http://example.com/","a:;",null,"INVALID_CHARACTER_ERR" 119 119 PASS 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. 120 PASS createDocument test: "http://example.com/","ெ:a",null,null 121 PASS createDocument test: metadata for "http://example.com/","ெ:a",null 122 PASS createDocument test: characterSet aliases for "http://example.com/","ெ:a",null 123 123 PASS createDocument test: "http://example.com/","̀:a",null,"INVALID_CHARACTER_ERR" 124 124 PASS 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 18 18 PASS createElementNS test in XML document: null,"foo1",null 19 19 PASS 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. 20 PASS createElementNS test in HTML document: null,"ெfoo",null 21 PASS createElementNS test in XML document: null,"ெfoo",null 22 PASS createElementNS test in XHTML document: null,"ெfoo",null 23 23 PASS createElementNS test in HTML document: null,";foo","INVALID_CHARACTER_ERR" 24 24 PASS createElementNS test in XML document: null,";foo","INVALID_CHARACTER_ERR" … … 210 210 PASS createElementNS test in XML document: "http://example.com/","a:_",null 211 211 PASS 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. 212 PASS createElementNS test in HTML document: "http://example.com/","a:ெ",null 213 PASS createElementNS test in XML document: "http://example.com/","a:ெ",null 214 PASS createElementNS test in XHTML document: "http://example.com/","a:ெ",null 215 215 PASS createElementNS test in HTML document: "http://example.com/","a:;","INVALID_CHARACTER_ERR" 216 216 PASS createElementNS test in XML document: "http://example.com/","a:;","INVALID_CHARACTER_ERR" … … 219 219 PASS createElementNS test in XML document: "http://example.com/","a:̀","INVALID_CHARACTER_ERR" 220 220 PASS 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. 221 PASS createElementNS test in HTML document: "http://example.com/","ெ:a",null 222 PASS createElementNS test in XML document: "http://example.com/","ெ:a",null 223 PASS createElementNS test in XHTML document: "http://example.com/","ெ:a",null 224 224 PASS createElementNS test in HTML document: "http://example.com/","̀:a","INVALID_CHARACTER_ERR" 225 225 PASS createElementNS test in XML document: "http://example.com/","̀:a","INVALID_CHARACTER_ERR" -
branches/safari-613-branch/Source/WebCore/ChangeLog
r288516 r288517 1 2022-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 1 75 2022-01-24 Alan Coon <alancoon@apple.com> 2 76 -
branches/safari-613-branch/Source/WebCore/dom/Document.cpp
r287818 r288517 398 398 static const Seconds intersectionObserversInitialUpdateDelay { 2000_ms }; 399 399 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] 415 402 static inline bool isValidNameStart(UChar32 c) 416 403 { 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] 441 412 static inline bool isValidNamePart(UChar32 c) 442 413 { 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); 469 416 } 470 417
Note:
See TracChangeset
for help on using the changeset viewer.