Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
apply same ShadowDOM polyfill defaulting rules to build and debug ver…
Browse files Browse the repository at this point in the history
…sions
  • Loading branch information
sorvell committed Aug 29, 2013
1 parent c661d9f commit 03ee74a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
17 changes: 13 additions & 4 deletions build/if-poly.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,19 @@ window.logFlags = window.logFlags || {};
o = o.split('=');
o[0] && (flags[o[0]] = o[1] || true);
});
// failure to detect native shadowDOM, or a 'truthy' value for any of these
// flags results in polyfill
flags.shadow = (flags.shadowdom || flags.shadow || flags.polyfill ||
!HTMLElement.prototype.webkitCreateShadowRoot) && 'polyfill';
// If any of these flags match 'native', then force native ShadowDOM; any
// other truthy value, or failure to detect native
// ShadowDOM, results in polyfill
flags.shadow = (flags.shadow || flags.shadowdom || flags.polyfill);
if (flags.shadow === 'native') {
flags.shadow = false;
} else {
flags.shadow = flags.shadow || !HTMLElement.prototype.createShadowRoot
&& 'polyfill';
}



// export
scope.flags = flags;
})(Platform);
Expand Down
5 changes: 0 additions & 5 deletions platform.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ function processFlags(flags) {
// use the minified build
this.modules = ['platform.min.js'];
} else {
// truthy value for any of these flags, or failure to detect native
// ShadowDOM, results in polyfill
//flags.shadow = (flags.shadowdom || flags.shadow || flags.polyfill ||
// !HTMLElement.prototype.createShadowRoot) && 'polyfill';

// If any of these flags match 'native', then force native ShadowDOM; any
// other truthy value, or failure to detect native
// ShadowDOM, results in polyfill
Expand Down

0 comments on commit 03ee74a

Please sign in to comment.