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

Issue 621942 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Jun 2016
Cc:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 1
Type: Bug



Sign in to add a comment

attachShadow is undefined in custom element constructor.

Project Member Reported by ericbidelman@chromium.org, Jun 21 2016

Issue description

Version: 53.0.2775.0 (64-bit)

`this.attachShadow` is undefined in custom element constructor. I believe this code should work:

  customElements.define('x-foo', class extends HTMLElement {
    constructor() {
      super();
      let shadowRoot = this.attachShadow({mode: 'open'});
      shadowRoot.innerHTML = `
        <b>I'm in shadow dom!</b>
        <slot></slot>
      `;
    }
  });

Chromium is complaining it's undefined.
 

Comment 1 by hayato@chromium.org, Jun 22 2016

Cc: kojii@chromium.org dominicc@chromium.org kochi@chromium.org
Owner: hayato@chromium.org
Status: Assigned (was: Untriaged)

Comment 2 by hayato@chromium.org, Jun 23 2016

Status: Started (was: Assigned)

Comment 3 by hayato@chromium.org, Jun 23 2016

Labels: -Pri-3 Pri-2

Comment 4 by hayato@chromium.org, Jun 23 2016

Labels: -Pri-2 Pri-1
Project Member

Comment 5 by bugdroid1@chromium.org, Jun 24 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/fa38a0afc1d55a8a625b87514d4799877c2d2ef7

commit fa38a0afc1d55a8a625b87514d4799877c2d2ef7
Author: hayato <hayato@chromium.org>
Date: Fri Jun 24 01:51:04 2016

Support Custom Elements v1 in attachShadow

After renaming CustomElement to CustomElementV0, it looks the support of Custom
Elements v1 in attachShadow has been forgotten. Fix it.

BUG= 531990 , 621942 

Review-Url: https://codereview.chromium.org/2092703002
Cr-Commit-Position: refs/heads/master@{#401779}

[modify] https://crrev.com/fa38a0afc1d55a8a625b87514d4799877c2d2ef7/third_party/WebKit/LayoutTests/shadow-dom/attach-shadow-safelist.html
[modify] https://crrev.com/fa38a0afc1d55a8a625b87514d4799877c2d2ef7/third_party/WebKit/Source/core/dom/Element.cpp

Comment 6 by hayato@chromium.org, Jun 24 2016

Status: Fixed (was: Started)

Sign in to add a comment