| OLD | NEW |
| (Empty) | |
| 1 /** |
| 2 @license |
| 3 Copyright (c) 2017 The Polymer Project Authors. All rights reserved. |
| 4 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt |
| 5 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt |
| 6 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt |
| 7 Code distributed by Google as part of the polymer project is also |
| 8 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt |
| 9 */ |
| 10 |
| 11 'use strict'; |
| 12 |
| 13 export let nativeShadow = !(window['ShadyDOM'] && window['ShadyDOM']['inUse']); |
| 14 export let nativeCssVariables; |
| 15 |
| 16 /** |
| 17 * @param {(ShadyCSSOptions | ShadyCSSInterface)=} settings |
| 18 */ |
| 19 function calcCssVariables(settings) { |
| 20 if (settings && settings['shimcssproperties']) { |
| 21 nativeCssVariables = false; |
| 22 } else { |
| 23 // chrome 49 has semi-working css vars, check if box-shadow works |
| 24 // safari 9.1 has a recalc bug: https://bugs.webkit.org/show_bug.cgi?id=1557
82 |
| 25 // However, shim css custom properties are only supported with ShadyDOM enab
led, |
| 26 // so fall back on native if we do not detect ShadyDOM |
| 27 nativeCssVariables = nativeShadow || Boolean(!navigator.userAgent.match('App
leWebKit/601') && |
| 28 window.CSS && CSS.supports && CSS.supports('box-shadow', '0 0 0 var(--foo)
')); |
| 29 } |
| 30 } |
| 31 |
| 32 if (window.ShadyCSS && window.ShadyCSS.nativeCss !== undefined) { |
| 33 nativeCssVariables = window.ShadyCSS.nativeCss; |
| 34 } else if (window.ShadyCSS) { |
| 35 calcCssVariables(window.ShadyCSS); |
| 36 // reset window variable to let ShadyCSS API take its place |
| 37 window.ShadyCSS = undefined; |
| 38 } else { |
| 39 calcCssVariables(window['WebComponents'] && window['WebComponents']['flags']); |
| 40 } |
| OLD | NEW |