Skip to content

Commit

Permalink
avoid < shadow > adjustments if running under ShadowDOM polyfill.
Browse files Browse the repository at this point in the history
  • Loading branch information
sorvell committed Nov 4, 2013
1 parent f8d3ebb commit 8243d57
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/declaration/prototype.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,16 @@
// https://www.w3.org/Bugs/Public/show_bug.cgi?id=22460
// make <shadow></shadow> be <shadow><content></content></shadow>
adjustShadowElement: function() {
var content = this.templateContent();
if (content) {
var s$ = content.querySelectorAll('shadow');
for (var i=0, l=s$.length, s; (i<l) && (s=s$[i]); i++) {
if (!s.children.length) {
s.appendChild(document.createElement('content'));
// TODO(sorvell): avoid under SD polyfill until this bug is addressed:
// https://github.com/Polymer/ShadowDOM/issues/297
if (!window.ShadowDOMPolyfill) {
var content = this.templateContent();
if (content) {
var s$ = content.querySelectorAll('shadow');
for (var i=0, l=s$.length, s; (i<l) && (s=s$[i]); i++) {
if (!s.children.length) {
s.appendChild(document.createElement('content'));
}
}
}
}
Expand Down

0 comments on commit 8243d57

Please sign in to comment.