diff --git a/platform.js b/platform.js index a440ee1..d35a1ec 100644 --- a/platform.js +++ b/platform.js @@ -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'