| 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 import CustomStyleInterface from '../src/custom-style-interface.js' |
| 14 import {getComputedStyleValue, updateNativeProperties} from '../src/common-utils
.js' |
| 15 import {nativeCssVariables, nativeShadow} from '../src/style-settings.js' |
| 16 |
| 17 const customStyleInterface = new CustomStyleInterface(); |
| 18 |
| 19 if (!window.ShadyCSS) { |
| 20 window.ShadyCSS = { |
| 21 /** |
| 22 * @param {HTMLTemplateElement} template |
| 23 * @param {string} elementName |
| 24 * @param {string=} elementExtends |
| 25 */ |
| 26 prepareTemplate(template, elementName, elementExtends) {}, // eslint-disable
-line no-unused-vars |
| 27 |
| 28 /** |
| 29 * @param {Element} element |
| 30 * @param {Object=} properties |
| 31 */ |
| 32 styleSubtree(element, properties) { |
| 33 customStyleInterface.processStyles(); |
| 34 updateNativeProperties(element, properties); |
| 35 }, |
| 36 |
| 37 /** |
| 38 * @param {Element} element |
| 39 */ |
| 40 styleElement(element) { // eslint-disable-line no-unused-vars |
| 41 customStyleInterface.processStyles(); |
| 42 }, |
| 43 |
| 44 /** |
| 45 * @param {Object=} properties |
| 46 */ |
| 47 styleDocument(properties) { |
| 48 customStyleInterface.processStyles(); |
| 49 updateNativeProperties(document.body, properties); |
| 50 }, |
| 51 |
| 52 /** |
| 53 * @param {Element} element |
| 54 * @param {string} property |
| 55 * @return {string} |
| 56 */ |
| 57 getComputedStyleValue(element, property) { |
| 58 return getComputedStyleValue(element, property); |
| 59 }, |
| 60 nativeCss: nativeCssVariables, |
| 61 nativeShadow: nativeShadow |
| 62 } |
| 63 } |
| 64 |
| 65 window.ShadyCSS.CustomStyleInterface = customStyleInterface; |
| OLD | NEW |