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

Commit

Permalink
Allow users to opt in to native ShadowDOM even when a fully supported…
Browse files Browse the repository at this point in the history
… version is not available via ?shadow=native.
  • Loading branch information
sorvell committed Aug 16, 2013
1 parent e53d666 commit e2f35a7
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions platform.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,20 @@ function processFlags(flags) {
} 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';
//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
flags.shadow = (flags.shadow || flags.shadowdom || flags.polyfill);
if (flags.shadow === 'native') {
flags.shadow = false;
} else {
flags.shadow = flags.shadow || !HTMLElement.prototype.createShadowRoot
&& 'polyfill';
}


var ShadowDOMNative = [
'src/patches-shadowdom-native.js'
Expand Down

0 comments on commit e2f35a7

Please sign in to comment.