New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 643052 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Email to this user bounced
Closed: Oct 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug

Blocking:
issue 643030



Sign in to add a comment

CustomElements: define element constructor check

Project Member Reported by davaajav@google.com, Sep 1 2016

Issue description

When defining an element, do not check whether the constructor is an interface object.

https://html.spec.whatwg.org/#dom-customelementregistry-define
 
Blockedon: 643030
Project Member

Comment 2 by sheriffbot@chromium.org, Sep 1 2016

Labels: Hotlist-Google
Blockedon: -643030
Blocking: 643030
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?  
Components: Blink>DOM
Status: Started (was: Untriaged)
Labels: -Pri-3 Pri-2
Owner: davaajav@google.com
Project Member

Comment 10 by bugdroid1@chromium.org, 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

Status: Fixed (was: Started)
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