From 43f57b102511006d5e8eb59dfa6600d55a7053db Mon Sep 17 00:00:00 2001 From: Daniel Freedman Date: Fri, 24 May 2019 11:18:39 -0700 Subject: [PATCH] Globally hide dom-{bind,if,repeat} elements with legacyOptmizations on Too many breaking tests internally to not hide them --- lib/elements/dom-bind.js | 4 ++-- lib/elements/dom-if.js | 4 ++-- lib/elements/dom-repeat.js | 4 ++-- lib/utils/hide-template-controls.js | 36 +++++++++++++++++++++++++++++ 4 files changed, 42 insertions(+), 6 deletions(-) create mode 100644 lib/utils/hide-template-controls.js diff --git a/lib/elements/dom-bind.js b/lib/elements/dom-bind.js index 72bfbbdd17..cc9b4f70ba 100644 --- a/lib/elements/dom-bind.js +++ b/lib/elements/dom-bind.js @@ -14,7 +14,7 @@ import { OptionalMutableData } from '../mixins/mutable-data.js'; import { GestureEventListeners } from '../mixins/gesture-event-listeners.js'; import { strictTemplatePolicy } from '../utils/settings.js'; import { wrap } from '../utils/wrap.js'; -import { legacyOptimizations } from '../utils/settings.js'; +import { hideElementsGlobally } from '../utils/hide-template-controls.js'; /** * @constructor @@ -76,7 +76,7 @@ export class DomBind extends domBindBase { * @return {void} */ connectedCallback() { - if (!legacyOptimizations) { + if (!hideElementsGlobally()) { this.style.display = 'none'; } this.render(); diff --git a/lib/elements/dom-if.js b/lib/elements/dom-if.js index 4fe29ef63d..2b4f23c70d 100644 --- a/lib/elements/dom-if.js +++ b/lib/elements/dom-if.js @@ -15,7 +15,7 @@ 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 { legacyOptimizations } from '../utils/settings.js'; +import { hideElementsGlobally } from '../utils/hide-template-controls.js'; /** * The `` element will stamp a light-dom `