diff --git a/externs/polymer-externs.js b/externs/polymer-externs.js index 06c7d6e9ba..f49bf21e0a 100644 --- a/externs/polymer-externs.js +++ b/externs/polymer-externs.js @@ -135,6 +135,30 @@ Polymer.legacyOptimizations; /** @type {boolean} */ Polymer.syncInitialRender; +/** @type {boolean} */ +Polymer.legacyUndefined; + +/** @type {boolean} */ +Polymer.legacyNoBatch; + +/** @type {boolean} */ +Polymer.legacyWarnings; + +/** @type {boolean} */ +Polymer.legacyNotifyOrder; + +/** @type {boolean} */ +Polymer.orderedComputed; + +/** @type {boolean} */ +Polymer.fastDomIf; + +/** @type {boolean} */ +Polymer.removeNestedTemplates; + +/** @type {boolean} */ +Polymer.suppressTemplateNotifications; + // nb. This is explicitly 'var', as Closure Compiler checks that this is the case. /** * @constructor diff --git a/externs/polymer-internal-shared-types.js b/externs/polymer-internal-shared-types.js index fd954c1180..8fd9637e6f 100644 --- a/externs/polymer-internal-shared-types.js +++ b/externs/polymer-internal-shared-types.js @@ -61,9 +61,13 @@ TemplateInfo.prototype.hostProps; /** @type {!Object} */ TemplateInfo.prototype.propertyEffects; /** @type {TemplateInfo | undefined} */ -TemplateInfo.prototype.nextTemplateInfo; +TemplateInfo.prototype.nextSibling; /** @type {TemplateInfo | undefined} */ -TemplateInfo.prototype.previousTemplateInfo; +TemplateInfo.prototype.previousSibling; +/** @type {TemplateInfo | undefined} */ +TemplateInfo.prototype.firstChild; +/** @type {TemplateInfo | undefined} */ +TemplateInfo.prototype.parent; /** @type {!Array} */ TemplateInfo.prototype.childNodes; /** @type {boolean} */ diff --git a/externs/webcomponents-externs.js b/externs/webcomponents-externs.js index 1d796ded48..b773a92834 100644 --- a/externs/webcomponents-externs.js +++ b/externs/webcomponents-externs.js @@ -1,6 +1,7 @@ /** * @fileoverview Externs for webcomponents polyfills * @externs + * @suppress {duplicate} * * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -12,42 +13,49 @@ */ /* eslint-disable */ -var HTMLImports = { - /** - * @param {function()} callback - */ - whenReady(callback) {}, - /** - * @param {!Node} element - * @return {?HTMLLinkElement|?Document|undefined} - */ - importForElement(element) {} -}; +var HTMLImports = {}; + +/** + * @param {function()=} callback + */ +HTMLImports.whenReady = function(callback) {}; + +/** + * Returns the import document containing the element. + * @param {!Node} element + * @return {?HTMLLinkElement|?Document|undefined} + */ +HTMLImports.importForElement = function(element) {}; window.HTMLImports = HTMLImports; -var ShadyDOM = { - inUse: false, - flush() {}, - /** - * @param {!Node} target - * @param {function(Array, MutationObserver)} callback - * @return {MutationObserver} - */ - observeChildren(target, callback) {}, - /** - * @param {MutationObserver} observer - */ - unobserveChildren(observer) {}, - /** - * @param {Node} node - */ - patch(node) {}, - /** - * @param {!ShadowRoot} shadowroot - */ - flushInitial(shadowroot) {} -}; +var ShadyDOM = {}; + +ShadyDOM.inUse; + +ShadyDOM.flush = function() {}; + +/** + * @param {!Node} target + * @param {function(Array, MutationObserver)} callback + * @return {MutationObserver} + */ +ShadyDOM.observeChildren = function(target, callback) {}; + +/** + * @param {MutationObserver} observer + */ +ShadyDOM.unobserveChildren = function(observer) {}; + +/** + * @param {Node} node + */ +ShadyDOM.patch = function(node) {}; + +/** + * @param {!ShadowRoot} shadowroot + */ +ShadyDOM.flushInitial = function(shadowroot) {}; window.ShadyDOM = ShadyDOM; @@ -66,3 +74,8 @@ HTMLTemplateElement.decorate = function(template){}; * @param {function(function())} cb callback */ CustomElementRegistry.prototype.polyfillWrapFlushCallback = function(cb){}; + +/** + * @param {string} cssText + */ +CSSStyleSheet.prototype.replaceSync = function(cssText) {}; diff --git a/interfaces.d.ts b/interfaces.d.ts index 5c04d71619..a72ed6487a 100644 --- a/interfaces.d.ts +++ b/interfaces.d.ts @@ -116,8 +116,6 @@ export interface TemplateInfo { hasInsertionPoint?: boolean; hostProps: Object; propertyEffects: Object; - nextTemplateInfo?: TemplateInfo; - previousTemplateInfo?: TemplateInfo; childNodes: Node[]; wasPreBound: boolean; } diff --git a/lib/elements/dom-if.js b/lib/elements/dom-if.js index 2b4f23c70d..729833a32c 100644 --- a/lib/elements/dom-if.js +++ b/lib/elements/dom-if.js @@ -9,36 +9,23 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN */ import { PolymerElement } from '../../polymer-element.js'; -import { templatize } from '../utils/templatize.js'; import { Debouncer } from '../utils/debounce.js'; import { enqueueDebouncer, flush } from '../utils/flush.js'; import { microTask } from '../utils/async.js'; import { root } from '../utils/path.js'; import { wrap } from '../utils/wrap.js'; import { hideElementsGlobally } from '../utils/hide-template-controls.js'; +import { fastDomIf, strictTemplatePolicy, suppressTemplateNotifications } from '../utils/settings.js'; +import { showHideChildren, templatize } from '../utils/templatize.js'; /** - * The `` element will stamp a light-dom `