Throw TypeError when custom element constructor returns a wrong element or tries...
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 15 Apr 2019 21:49:06 +0000 (21:49 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 15 Apr 2019 21:49:06 +0000 (21:49 +0000)
commitc99e44d2a3d652c7bd91cad15a293cbed0f2c18d
tree53de20548ca63a392f325d2d19a6a73da2545ede
parentd5055bb7da4bceef12a59ace0b79eed383cdf6ef
Throw TypeError when custom element constructor returns a wrong element or tries to create itself
https://bugs.webkit.org/show_bug.cgi?id=196892

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

Update the tests according to https://github.com/web-platform-tests/wpt/pull/16328.

* web-platform-tests/custom-elements/upgrading/Node-cloneNode-expected.txt:
* web-platform-tests/custom-elements/upgrading/Node-cloneNode.html:
* web-platform-tests/custom-elements/upgrading/upgrading-parser-created-element-expected.txt:
* web-platform-tests/custom-elements/upgrading/upgrading-parser-created-element.html:

Source/WebCore:

Throw TypeError instead of InvalidStateError for consistency. This updates WebKit's custom elements
implementation for https://github.com/whatwg/html/pull/4525.

Tests: imported/w3c/web-platform-tests/custom-elements/upgrading/Node-cloneNode.html
       imported/w3c/web-platform-tests/custom-elements/upgrading/upgrading-parser-created-element.html

* bindings/js/JSCustomElementInterface.cpp:
(WebCore::JSCustomElementInterface::upgradeElement):
* bindings/js/JSHTMLElementCustom.cpp:
(WebCore::constructJSHTMLElement):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244293 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/custom-elements/upgrading/Node-cloneNode-expected.txt
LayoutTests/imported/w3c/web-platform-tests/custom-elements/upgrading/Node-cloneNode.html
LayoutTests/imported/w3c/web-platform-tests/custom-elements/upgrading/upgrading-parser-created-element-expected.txt
LayoutTests/imported/w3c/web-platform-tests/custom-elements/upgrading/upgrading-parser-created-element.html
Source/WebCore/ChangeLog
Source/WebCore/bindings/js/JSCustomElementInterface.cpp
Source/WebCore/bindings/js/JSHTMLElementCustom.cpp