Skip to content

Commit

Permalink
Changes based on review.
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Orvell committed Oct 9, 2019
1 parent ab04377 commit 124d878
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions lib/utils/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,26 @@ Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/
import './boot.js';

import { pathFromUrl } from './resolve-url.js';
export const useShadow = !(window.ShadyDOM) || !(window.ShadyDOM.inUse);
export const useNativeCSSProperties = Boolean(!window.ShadyCSS || window.ShadyCSS.nativeCss);
export const useNativeCustomElements = !(window.customElements.polyfillWrapFlushCallback);
export const supportsAdoptingStyleSheets = useShadow &&
('adoptedStyleSheets' in Document.prototype) &&
('replaceSync' in CSSStyleSheet.prototype);

('replaceSync' in CSSStyleSheet.prototype) &&
// Since space may change, feature detect exact API we need
(() => {
try {
const sheet = new CSSStyleSheet();
sheet.replaceSync('');
const host = document.createElement('div');
host.attachShadow({mode: 'open'});
host.shadowRoot.adoptedStyleSheets = [sheet];
return (host.shadowRoot.adoptedStyleSheets[0] === sheet);
} catch(e) {
return false;
}
})();

/**
* Globally settable property that is automatically assigned to
Expand Down

0 comments on commit 124d878

Please sign in to comment.