Skip to content

Loading…

Content nodes in `dom-if` template do not distribute correctly #1753

Closed
brianchin opened this Issue · 2 comments

3 participants

@brianchin

The following HTML page causes a TypeError when loaded:

<!DOCTYPE html>
<html>
  <head>
    <script>
var Polymer = Polymer || {};
// Uncomment and the error disappears.
// Polymer.dom = 'shadow';
    </script>
    <script src="../webcomponentsjs/webcomponents-lite.js"></script>
    <link rel="import" href="../polymer/polymer.html">
  </head>
  <body>

    <!-- Define test element -->
    <dom-module id="test-elem1">
      <template>
        <content></content>
      </template>
    </dom-module>

    <dom-module id="test-elem2">
      <template>
        <test-elem1>
          <template is="dom-if" if="true">
            <content></content>
          </template>
        </test-elem1>
      </template>
    </dom-module>
    <script>
Polymer({
  is: 'test-elem1',
});

Polymer({
  is: 'test-elem2',
});
    </script>
    <!--
      if using native shadow DOM, works correctly, showing "Hello, World!".
      with shady DOM, causes a TypeError in clearDistributedDestinationInsertionPoints().
    -->
    <test-elem2 id="foo">
      <div>Hello, World!</div>
    </test-elem2>
  </body>
</html>

I've tested this in Chrome. Firefox was a little pickier with my code, so I can't say for certain that it also raises an error, but I suspect so.

@kevinpschaaf kevinpschaaf changed the title from Content nodes in template in another custom element do not distribute correctly to Content nodes in `dom-if` template do not distribute correctly
@kevinpschaaf kevinpschaaf added the p2 label
@sorvell sorvell was assigned by kevinpschaaf
@sorvell sorvell was unassigned by kevinpschaaf
@kevinpschaaf kevinpschaaf self-assigned this
@kevinpschaaf
Owner

Should be same fix as #1631.

@kevinpschaaf

Will be fixed by #1816

Confirmed fix in repro case here:
http://jsbin.com/hucire/3/edit

@sorvell sorvell closed this in #1816
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.