Crash when using custom element inside of another custom element

NEW
Unassigned

Status

()

Core
DOM: Core & HTML
3 years ago
3 years ago

People

(Reporter: lightsofapollo, Unassigned)

Tracking

(Blocks: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

3 years ago
STR (sitting across from wchen now but here for record keeping):

Use my gaia branch:

https://github.com/lightsofapollo/gaia/tree/terrible-crash-fun

Open gaia/shared/elements/gaia_grid/examples/index.html (relative to to the gaia checkout)

Click the "Another Webapp" icon

<crash should happen>
Blocks: 811542
(Reporter)

Comment 1

3 years ago
Using .createElement for the additional custom element seems to cause the crash using innerHTML on another element (that is not in the dom) seems to help:

```
      var wrapper = document.createElement('div');
      wrapper.innerHTML =
          '<gaia-confirm id="confirm-message">' +
            '<h1 id="confirmation-message-title"></h1>' +
            '<p id="confirmation-message-body"></p>' +
            '<gaia-buttons skin="dark">' +
              '<button class="cancel" id="confirmation-message-cancel" type="button"></button>' +
              '<button class="confirm" id="confirmation-message-ok" type="button"></button>' +
            '</gaia-buttons>' +
          '</gaia-confirm>'

      var element = wrapper.firstElementChild;
```

My work around

Comment 2

3 years ago
I can't reproduce this based on the checkout, your branch and dom.webcomponents.enabled set to true using 37.0a2 (2015-01-24). 

I'm not sure the page is running correctly, however. The "A Webapp" and "Another Webapp" are large white rectangles and clicking on "Another Webapp" does nothing except print "show cancel~>~>~" to the console.

Although there's no crash, I suspect something isn't working correctly, nonetheless. 

(Incidentally, I've had experiences with the browser version above not showing web components within web components and crashing on complex apps, too. But this is with apps built with Polymer and the missing inner web components and crashes only occur when the above config is set to true.)
You need to log in before you can comment on or make changes to this bug.