Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make CustomElementConstructor exceptions more consistent #4525

Merged
merged 1 commit into from Apr 15, 2019

Conversation

2 participants
@annevk
Copy link
Member

annevk commented Apr 12, 2019

And allow for simplification of "create an element" by moving a step into IDL.

Tests: maybe https://bugzilla.mozilla.org/show_bug.cgi?id=1543570.

Corresponding DOM changes: ...

Fixes #4520.

Make CustomElementConstructor exceptions more consistent
And allow for simplification of "create an element" by moving a step into IDL.

Tests: maybe https://bugzilla.mozilla.org/show_bug.cgi?id=1543570.

Corresponding DOM changes: ...

Fixes #4520.

annevk added a commit to whatwg/dom that referenced this pull request Apr 12, 2019

Editorial: use IDL to simplify create an element
Per whatwg/html#4525 a custom element constructor is required to be an HTMLElement.

Also, rather than assume another specification will make foreign namespace objects implement HTMLElement, let's instead assert that does not happen as we cannot test it.

annevk added a commit to web-platform-tests/wpt that referenced this pull request Apr 12, 2019

@domenic
Copy link
Member

domenic left a comment

LGTM. It's weird that this causes a normative change to DOM, not HTML, but I guess that's intertwingling for you.

Thanks for jumping on this.

@annevk annevk removed the needs tests label Apr 15, 2019

annevk added a commit to web-platform-tests/wpt that referenced this pull request Apr 15, 2019

@annevk annevk merged commit b1b08e1 into master Apr 15, 2019

2 checks passed

Participation annevk participates on behalf of Mozilla Corporation
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@annevk annevk deleted the annevk/customelementconstructor-exceptions branch Apr 15, 2019

annevk added a commit to whatwg/dom that referenced this pull request Apr 15, 2019

Editorial: use IDL to simplify create an element
Per whatwg/html#4525 a custom element constructor is required to be an HTMLElement.

Also, rather than assume another specification will make foreign namespace objects implement HTMLElement, let's instead assert that does not happen as we cannot test it.

annulen pushed a commit to annulen/webkit that referenced this pull request Apr 18, 2019

rniwa@webkit.org
Throw TypeError when custom element constructor returns a wrong eleme…
…nt 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 web-platform-tests/wpt#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 whatwg/html#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: http://svn.webkit.org/repository/webkit/trunk@244293 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.