background-color: red; }`;
      var div = shadow.appendChild(document.createElement('div'));
      div.textContent = 'This is custom-elem';
      var subElem = shadow.appendChild(document.createElement('custom-subelem'));
    }
  },
);

customElements.define(
  'custom-subelem',
  class CustomSubElem extends HTMLElement {
    constructor() {
      super();
      var shadow = this.attachShadow({mode: 'open'});
      var style = shadow.appendChild(document.createElement('style'));
      style.textContent = `