Changeset 203441 in webkit
- Timestamp:
- Jul 19, 2016, 6:45:51 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 13 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/dom/Document/createAttributeNS-namespace-err-expected.txt (modified) (1 diff)
-
LayoutTests/fast/dom/Document/createElementNS-namespace-err-expected.txt (modified) (1 diff)
-
LayoutTests/fast/dom/Document/script-tests/createAttributeNS-namespace-err.js (modified) (2 diffs)
-
LayoutTests/fast/dom/Document/script-tests/createElementNS-namespace-err.js (modified) (2 diffs)
-
LayoutTests/fast/dom/attribute-downcast-right.html (modified) (1 diff)
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/dom/interfaces-expected.txt (modified) (6 diffs)
-
LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Document-createElementNS-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt (modified) (6 diffs)
-
LayoutTests/svg/dom/element-removed-while-inserting-parent-crash.html (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/dom/Document.idl (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r203439 r203441 1 2016-07-19 Chris Dumez <cdumez@apple.com> 2 3 Document.createElementNS() / createAttributeNS() parameters should be mandatory 4 https://bugs.webkit.org/show_bug.cgi?id=159938 5 6 Reviewed by Benjamin Poulain. 7 8 Update / rebaseline existing tests to reflect the behavior change. 9 10 * fast/dom/Document/createAttributeNS-namespace-err-expected.txt: 11 * fast/dom/Document/createElementNS-namespace-err-expected.txt: 12 * fast/dom/Document/script-tests/createAttributeNS-namespace-err.js: 13 * fast/dom/Document/script-tests/createElementNS-namespace-err.js: 14 * fast/dom/attribute-downcast-right.html: 15 1 16 2016-07-19 Benjamin Poulain <bpoulain@apple.com> 2 17 -
trunk/LayoutTests/fast/dom/Document/createAttributeNS-namespace-err-expected.txt
r105391 r203441 4 4 5 5 6 PASS document.createAttributeNS() .toString() is "[object Attr]"7 PASS document.createAttributeNS("http://www.example.com") .toString() is "[object Attr]"6 PASS document.createAttributeNS() threw exception TypeError: Not enough arguments. 7 PASS document.createAttributeNS("http://www.example.com") threw exception TypeError: Not enough arguments. 8 8 PASS createAttributeNS(undefined, undefined) 9 9 PASS createAttributeNS(null, undefined) 10 PASS createAttributeNS(undefined, null) ; threw INVALID_CHARACTER_ERR11 PASS createAttributeNS(null, null) ; threw INVALID_CHARACTER_ERR10 PASS createAttributeNS(undefined, null) 11 PASS createAttributeNS(null, null) 12 12 PASS createAttributeNS(null, ""); threw INVALID_CHARACTER_ERR 13 PASS createAttributeNS("", null) ; threw INVALID_CHARACTER_ERR13 PASS createAttributeNS("", null) 14 14 PASS createAttributeNS("", ""); threw INVALID_CHARACTER_ERR 15 15 PASS createAttributeNS(null, "<div>"); threw INVALID_CHARACTER_ERR -
trunk/LayoutTests/fast/dom/Document/createElementNS-namespace-err-expected.txt
r189842 r203441 4 4 5 5 6 PASS document.createElementNS() .toString() is "[object Element]"7 PASS document.createElementNS("http://www.example.com") .toString() is "[object Element]"6 PASS document.createElementNS() threw exception TypeError: Not enough arguments. 7 PASS document.createElementNS("http://www.example.com") threw exception TypeError: Not enough arguments. 8 8 HTML tests: 9 9 PASS createElementNS(, ) 10 10 PASS createElementNS(null, ) 11 PASS createElementNS(, null) ; threw INVALID_CHARACTER_ERR12 PASS createElementNS(null, null) ; threw INVALID_CHARACTER_ERR11 PASS createElementNS(, null) 12 PASS createElementNS(null, null) 13 13 PASS createElementNS(null, ""); threw INVALID_CHARACTER_ERR 14 PASS createElementNS("", null) ; threw INVALID_CHARACTER_ERR14 PASS createElementNS("", null) 15 15 PASS createElementNS("", ""); threw INVALID_CHARACTER_ERR 16 16 PASS createElementNS(null, "<div>"); threw INVALID_CHARACTER_ERR -
trunk/LayoutTests/fast/dom/Document/script-tests/createAttributeNS-namespace-err.js
r105391 r203441 38 38 { args: [undefined, undefined] }, 39 39 { args: [null, undefined] }, 40 { args: [undefined, null] , code: 5},41 { args: [null, null] , code: 5},40 { args: [undefined, null] }, 41 { args: [null, null] }, 42 42 { args: [null, ""], code: 5 }, 43 { args: ["", null] , code: 5},43 { args: ["", null] }, 44 44 { args: ["", ""], code: 5 }, 45 45 { args: [null, "<div>"], code: 5 }, … … 124 124 } 125 125 126 // Moz throws a "Not enough arguments" exception in these, we don't: 127 shouldBeEqualToString("document.createAttributeNS().toString()", "[object Attr]"); 128 shouldBeEqualToString("document.createAttributeNS(\"http://www.example.com\").toString()", "[object Attr]"); 126 shouldThrow("document.createAttributeNS()", "'TypeError: Not enough arguments'"); 127 shouldThrow("document.createAttributeNS(\"http://www.example.com\")", "'TypeError: Not enough arguments'"); 129 128 130 129 runNSTests(); -
trunk/LayoutTests/fast/dom/Document/script-tests/createElementNS-namespace-err.js
r189842 r203441 38 38 { args: [undefined, undefined] }, 39 39 { args: [null, undefined] }, 40 { args: [undefined, null] , code: 5},41 { args: [null, null] , code: 5},40 { args: [undefined, null] }, 41 { args: [null, null] }, 42 42 { args: [null, ""], code: 5 }, 43 { args: ["", null] , code: 5},43 { args: ["", null] }, 44 44 { args: ["", ""], code: 5 }, 45 45 { args: [null, "<div>"], code: 5 }, … … 158 158 } 159 159 160 // Moz throws a "Not enough arguments" exception in these, we don't: 161 shouldBeEqualToString("document.createElementNS().toString()", "[object Element]"); 162 shouldBeEqualToString("document.createElementNS(\"http://www.example.com\").toString()", "[object Element]"); 160 shouldThrow("document.createElementNS()", "'TypeError: Not enough arguments'"); 161 shouldThrow("document.createElementNS(\"http://www.example.com\")", "'TypeError: Not enough arguments'"); 163 162 164 163 debug("HTML tests:") -
trunk/LayoutTests/fast/dom/attribute-downcast-right.html
r120792 r203441 4 4 5 5 var oElement = document.createElement("s") 6 var oElementNS = document.createElementNS( );6 var oElementNS = document.createElementNS(null, "test"); 7 7 oElementNS.setAttributeNS(); 8 8 var oAttributeNS = oElementNS.getAttributeNodeNS(); -
trunk/LayoutTests/imported/w3c/ChangeLog
r203428 r203441 1 2016-07-19 Chris Dumez <cdumez@apple.com> 2 3 Document.createElementNS() / createAttributeNS() parameters should be mandatory 4 https://bugs.webkit.org/show_bug.cgi?id=159938 5 6 Reviewed by Benjamin Poulain. 7 8 Rebaseline several W3C tests now that more checks are passing. 9 10 * web-platform-tests/dom/interfaces-expected.txt: 11 * web-platform-tests/dom/nodes/Document-createElementNS-expected.txt: 12 * web-platform-tests/html/dom/interfaces-expected.txt: 13 1 14 2016-07-19 Chris Dumez <cdumez@apple.com> 2 15 -
trunk/LayoutTests/imported/w3c/web-platform-tests/dom/interfaces-expected.txt
r203377 r203441 260 260 FAIL Document interface: operation getElementsByClassName(DOMString) assert_equals: property has wrong .length expected 1 but got 0 261 261 PASS Document interface: operation createElement(DOMString,ElementCreationOptions) 262 FAIL Document interface: operation createElementNS(DOMString,DOMString,ElementCreationOptions) assert_equals: property has wrong .length expected 2 but got 0 262 PASS Document interface: operation createElementNS(DOMString,DOMString,ElementCreationOptions) 263 263 PASS Document interface: operation createDocumentFragment() 264 264 FAIL Document interface: operation createTextNode(DOMString) assert_equals: property has wrong .length expected 1 but got 0 … … 268 268 PASS Document interface: operation adoptNode(Node) 269 269 FAIL Document interface: operation createAttribute(DOMString) assert_equals: property has wrong .length expected 1 but got 0 270 FAIL Document interface: operation createAttributeNS(DOMString,DOMString) assert_equals: property has wrong .length expected 2 but got 0 270 PASS Document interface: operation createAttributeNS(DOMString,DOMString) 271 271 FAIL Document interface: operation createEvent(DOMString) assert_equals: property has wrong .length expected 1 but got 0 272 272 PASS Document interface: operation createRange() … … 310 310 PASS Document interface: calling createElement(DOMString,ElementCreationOptions) on new Document() with too few arguments must throw TypeError 311 311 PASS Document interface: new Document() must inherit property "createElementNS" with the proper type (15) 312 FAIL Document interface: calling createElementNS(DOMString,DOMString,ElementCreationOptions) on new Document() with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () { 313 fn.apply(obj, args); 314 }" did not throw 312 PASS Document interface: calling createElementNS(DOMString,DOMString,ElementCreationOptions) on new Document() with too few arguments must throw TypeError 315 313 PASS Document interface: new Document() must inherit property "createDocumentFragment" with the proper type (16) 316 314 PASS Document interface: new Document() must inherit property "createTextNode" with the proper type (17) … … 335 333 }" did not throw 336 334 PASS Document interface: new Document() must inherit property "createAttributeNS" with the proper type (23) 337 FAIL Document interface: calling createAttributeNS(DOMString,DOMString) on new Document() with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () { 338 fn.apply(obj, args); 339 }" did not throw 335 PASS Document interface: calling createAttributeNS(DOMString,DOMString) on new Document() with too few arguments must throw TypeError 340 336 PASS Document interface: new Document() must inherit property "createEvent" with the proper type (24) 341 337 FAIL Document interface: calling createEvent(DOMString) on new Document() with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () { … … 476 472 PASS Document interface: calling createElement(DOMString,ElementCreationOptions) on xmlDoc with too few arguments must throw TypeError 477 473 PASS Document interface: xmlDoc must inherit property "createElementNS" with the proper type (15) 478 FAIL Document interface: calling createElementNS(DOMString,DOMString,ElementCreationOptions) on xmlDoc with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () { 479 fn.apply(obj, args); 480 }" did not throw 474 PASS Document interface: calling createElementNS(DOMString,DOMString,ElementCreationOptions) on xmlDoc with too few arguments must throw TypeError 481 475 PASS Document interface: xmlDoc must inherit property "createDocumentFragment" with the proper type (16) 482 476 PASS Document interface: xmlDoc must inherit property "createTextNode" with the proper type (17) … … 501 495 }" did not throw 502 496 PASS Document interface: xmlDoc must inherit property "createAttributeNS" with the proper type (23) 503 FAIL Document interface: calling createAttributeNS(DOMString,DOMString) on xmlDoc with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () { 504 fn.apply(obj, args); 505 }" did not throw 497 PASS Document interface: calling createAttributeNS(DOMString,DOMString) on xmlDoc with too few arguments must throw TypeError 506 498 PASS Document interface: xmlDoc must inherit property "createEvent" with the proper type (24) 507 499 FAIL Document interface: calling createEvent(DOMString) on xmlDoc with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () { -
trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Document-createElementNS-expected.txt
r203333 r203441 157 157 PASS createElementNS test 154: "foo:","xmlfoo:bar",null 158 158 PASS createElementNS test 155: "","","INVALID_CHARACTER_ERR" 159 FAIL createElementNS test 156: null,null,null The string contains invalid characters. 159 PASS createElementNS test 156: null,null,null 160 160 PASS createElementNS test 157: null,"","INVALID_CHARACTER_ERR" 161 FAIL createElementNS test 158: undefined,null,null The string contains invalid characters. 161 PASS createElementNS test 158: undefined,null,null 162 162 PASS createElementNS test 159: undefined,undefined,null 163 163 PASS createElementNS test 160: undefined,"","INVALID_CHARACTER_ERR" 164 FAIL createElementNS test 161: "http://example.com/",null,null The string contains invalid characters. 164 PASS createElementNS test 161: "http://example.com/",null,null 165 165 PASS createElementNS test 162: "http://example.com/","","INVALID_CHARACTER_ERR" 166 FAIL createElementNS test 163: "/",null,null The string contains invalid characters. 166 PASS createElementNS test 163: "/",null,null 167 167 PASS createElementNS test 164: "/","","INVALID_CHARACTER_ERR" 168 FAIL createElementNS test 165: "http://www.w3.org/XML/1998/namespace",null,null The string contains invalid characters. 168 PASS createElementNS test 165: "http://www.w3.org/XML/1998/namespace",null,null 169 169 PASS createElementNS test 166: "http://www.w3.org/XML/1998/namespace","","INVALID_CHARACTER_ERR" 170 FAIL createElementNS test 167: "http://www.w3.org/2000/xmlns/",null,"NAMESPACE_ERR" assert_throws: function "function () { document.createElementNS(namespace, qualifi..." threw object "InvalidCharacterError (DOM Exception 5): The string conta..." that is not a DOMException NAMESPACE_ERR: property "code" is equal to 5, expected 14 170 PASS createElementNS test 167: "http://www.w3.org/2000/xmlns/",null,"NAMESPACE_ERR" 171 171 PASS createElementNS test 168: "http://www.w3.org/2000/xmlns/","","INVALID_CHARACTER_ERR" 172 FAIL createElementNS test 169: "foo:",null,null The string contains invalid characters. 172 PASS createElementNS test 169: "foo:",null,null 173 173 PASS createElementNS test 170: "foo:","","INVALID_CHARACTER_ERR" 174 174 PASS Lower-case HTML element without a prefix -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt
r203377 r203441 150 150 PASS Document interface: calling createElement(DOMString) on iframe.contentDocument with too few arguments must throw TypeError 151 151 PASS Document interface: iframe.contentDocument must inherit property "createElementNS" with the proper type (15) 152 FAIL Document interface: calling createElementNS(DOMString,DOMString) on iframe.contentDocument with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () { 153 fn.apply(obj, args); 154 }" did not throw 152 PASS Document interface: calling createElementNS(DOMString,DOMString) on iframe.contentDocument with too few arguments must throw TypeError 155 153 PASS Document interface: iframe.contentDocument must inherit property "createDocumentFragment" with the proper type (16) 156 154 PASS Document interface: iframe.contentDocument must inherit property "createTextNode" with the proper type (17) … … 175 173 }" did not throw 176 174 PASS Document interface: iframe.contentDocument must inherit property "createAttributeNS" with the proper type (23) 177 FAIL Document interface: calling createAttributeNS(DOMString,DOMString) on iframe.contentDocument with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () { 178 fn.apply(obj, args); 179 }" did not throw 175 PASS Document interface: calling createAttributeNS(DOMString,DOMString) on iframe.contentDocument with too few arguments must throw TypeError 180 176 PASS Document interface: iframe.contentDocument must inherit property "createEvent" with the proper type (24) 181 177 FAIL Document interface: calling createEvent(DOMString) on iframe.contentDocument with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () { … … 452 448 PASS Document interface: calling createElement(DOMString) on new Document() with too few arguments must throw TypeError 453 449 PASS Document interface: new Document() must inherit property "createElementNS" with the proper type (15) 454 FAIL Document interface: calling createElementNS(DOMString,DOMString) on new Document() with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () { 455 fn.apply(obj, args); 456 }" did not throw 450 PASS Document interface: calling createElementNS(DOMString,DOMString) on new Document() with too few arguments must throw TypeError 457 451 PASS Document interface: new Document() must inherit property "createDocumentFragment" with the proper type (16) 458 452 PASS Document interface: new Document() must inherit property "createTextNode" with the proper type (17) … … 477 471 }" did not throw 478 472 PASS Document interface: new Document() must inherit property "createAttributeNS" with the proper type (23) 479 FAIL Document interface: calling createAttributeNS(DOMString,DOMString) on new Document() with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () { 480 fn.apply(obj, args); 481 }" did not throw 473 PASS Document interface: calling createAttributeNS(DOMString,DOMString) on new Document() with too few arguments must throw TypeError 482 474 PASS Document interface: new Document() must inherit property "createEvent" with the proper type (24) 483 475 FAIL Document interface: calling createEvent(DOMString) on new Document() with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () { … … 757 749 PASS Document interface: calling createElement(DOMString) on document.implementation.createDocument(null, "", null) with too few arguments must throw TypeError 758 750 PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "createElementNS" with the proper type (15) 759 FAIL Document interface: calling createElementNS(DOMString,DOMString) on document.implementation.createDocument(null, "", null) with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () { 760 fn.apply(obj, args); 761 }" did not throw 751 PASS Document interface: calling createElementNS(DOMString,DOMString) on document.implementation.createDocument(null, "", null) with too few arguments must throw TypeError 762 752 PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "createDocumentFragment" with the proper type (16) 763 753 PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "createTextNode" with the proper type (17) … … 782 772 }" did not throw 783 773 PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "createAttributeNS" with the proper type (23) 784 FAIL Document interface: calling createAttributeNS(DOMString,DOMString) on document.implementation.createDocument(null, "", null) with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () { 785 fn.apply(obj, args); 786 }" did not throw 774 PASS Document interface: calling createAttributeNS(DOMString,DOMString) on document.implementation.createDocument(null, "", null) with too few arguments must throw TypeError 787 775 PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "createEvent" with the proper type (24) 788 776 FAIL Document interface: calling createEvent(DOMString) on document.implementation.createDocument(null, "", null) with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () { -
trunk/LayoutTests/svg/dom/element-removed-while-inserting-parent-crash.html
r185769 r203441 6 6 testRunner.dumpAsText(); 7 7 8 var element = document.createElementNS('http://www.w3.org/2000/svg' );8 var element = document.createElementNS('http://www.w3.org/2000/svg', "test"); 9 9 10 10 var script = document.createElementNS('http://www.w3.org/2000/svg', 'script'); -
trunk/Source/WebCore/ChangeLog
r203439 r203441 1 2016-07-19 Chris Dumez <cdumez@apple.com> 2 3 Document.createElementNS() / createAttributeNS() parameters should be mandatory 4 https://bugs.webkit.org/show_bug.cgi?id=159938 5 6 Reviewed by Benjamin Poulain. 7 8 Document.createElementNS() / createAttributeNS() parameters should be mandatory: 9 - https://dom.spec.whatwg.org/#document 10 11 They were optional in WebKit. However, Firefox and Chrome both match the 12 specification. 13 14 No new tests, rebaselined existing tests. 15 16 * dom/Document.idl: 17 1 18 2016-07-19 Benjamin Poulain <bpoulain@apple.com> 2 19 -
trunk/Source/WebCore/dom/Document.idl
r203047 r203441 59 59 [ObjCLegacyUnnamedParameters, NewObject, RaisesException] Node importNode(Node importedNode, optional boolean deep = false); 60 60 61 // FIXME: 'qualifiedName' should not have [TreatNullAs=EmptyString]. 62 // FIXME: Using "undefined" as default parameter value is wrong. 63 [ObjCLegacyUnnamedParameters, NewObject, RaisesException] Element createElementNS(optional DOMString? namespaceURI = null, 64 [TreatNullAs=EmptyString] optional DOMString qualifiedName = "undefined"); 65 66 // FIXME: 'qualifiedName' should not have [TreatNullAs=EmptyString]. 67 // FIXME: Using "undefined" as default parameter value is wrong. 68 [ObjCLegacyUnnamedParameters, NewObject, RaisesException] Attr createAttributeNS(optional DOMString? namespaceURI = null, 69 [TreatNullAs=EmptyString] optional DOMString qualifiedName = "undefined"); 61 [ObjCLegacyUnnamedParameters, NewObject, RaisesException] Element createElementNS(DOMString? namespaceURI, DOMString qualifiedName); 62 [ObjCLegacyUnnamedParameters, NewObject, RaisesException] Attr createAttributeNS(DOMString? namespaceURI, DOMString qualifiedName); 70 63 71 64 #if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
Note:
See TracChangeset
for help on using the changeset viewer.