Skip to content

Commit

Permalink
Correctly clone style elements in a ShadowDOM polyfill safe way (see h…
Browse files Browse the repository at this point in the history
  • Loading branch information
sorvell committed Jun 14, 2013
1 parent 96284ae commit 597bd0d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/styling.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,14 @@

function applyStyleToScope(style, scope) {
if (style) {
scope.appendChild(style.cloneNode(true));
var clone = style.cloneNode(true);
// TODO(sorvell): this is here for IE, which requires deep cloning
// of style elements.
// see https://github.com/Polymer/ShadowDOM/issues/165
if (window.ShadowDOMPolyfill) {
clone.textContent = style.textContent;
}
scope.appendChild(clone);
}
}

Expand Down

0 comments on commit 597bd0d

Please sign in to comment.