You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var html = "<my-elem>hello world</my-elem>";
var el1 = document.createElement("div");
el1.innerHTML = html;
var el2 = document.createElement("div");
el2.innerHTML = el1.innerHTML;
After, el2:
<my-elem>
<div class="abc">
<div class="abc">
hello world
</div>
</div>
</my-elem>
Shady DOM should check if el2 is post-processed when trying to insert client content at insert point.
The text was updated successfully, but these errors were encountered:
You may interesting why I convert HTML and element back and forth, basically, it is because localization and extracting templates from bulk of HTML, it's another story.
You'll running up against one of the limitations of the Shady DOM shim here. For reasons of practicality and performance, Shady DOM does not attempt to modify dom accessors to behave like Shadow DOM.
Instead the Polymer.dom api is provided to produce normalized output. In this case, e1.innerHTML is giving you the fully composed dom and you likely want scoped/local dom. Instead you should use Polymer.dom(e1).innerHTML. Here's a jsbin sample:
My element:
Scripts:
After, el2:
Shady DOM should check if el2 is post-processed when trying to insert client content at insert point.
The text was updated successfully, but these errors were encountered: