CustomElements: define element constructor check |
||||||||
Issue descriptionWhen defining an element, do not check whether the constructor is an interface object. https://html.spec.whatwg.org/#dom-customelementregistry-define
,
Sep 1 2016
,
Sep 2 2016
,
Sep 2 2016
,
Sep 2 2016
https://html.spec.whatwg.org/multipage/dom.html#elements-in-the-dom Step 4.1 If the active function object is not HTMLElement, then throw a TypeError and abort these steps. I guess this check was removed from define element to HTML element constructor. Taking out the tests from define-element.html and add them to construct.html seems more appropriate?
,
Sep 2 2016
,
Sep 7 2016
,
Sep 7 2016
Patch up at https://codereview.chromium.org/2320553002
,
Sep 8 2016
,
Sep 30 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/6147d4d4ffe38e7b0d292677e9c309b5b3509dab commit 6147d4d4ffe38e7b0d292677e9c309b5b3509dab Author: davaajav <davaajav@google.com> Date: Fri Sep 30 04:50:46 2016 Custom Elements: HTMLElement constructor tests 1. Removed constructor checks from define-element.html and add them in construct.html 2. Constructing a custom element with new should change the state to "custom". 3. Creating or upgrading an element that is an already constructed marker should throw "InvalidStateError"DOMException. However, when an element is constructed with new, the construction stack is empty the whole time, thus it will not throw "InvalidStateError". BUG= 643052 Review-Url: https://codereview.chromium.org/2320553002 Cr-Commit-Position: refs/heads/master@{#422031} [modify] https://crrev.com/6147d4d4ffe38e7b0d292677e9c309b5b3509dab/third_party/WebKit/LayoutTests/custom-elements/spec/construct.html [modify] https://crrev.com/6147d4d4ffe38e7b0d292677e9c309b5b3509dab/third_party/WebKit/LayoutTests/custom-elements/spec/define-element.html
,
Oct 27 2016
I think the original point about not checking whether the object is an interface prototype object is obsolete. IIRC we never actually implemented that part of the spec before it was deleted. That check is *effectively* done in the HTML constructors now, when they check whether the active function object is the interface object and abort. We do implement that part. |
||||||||
►
Sign in to add a comment |
||||||||
Comment 1 by davaajav@google.com
, Sep 1 2016