From 65859b1cd7d93a1e719f36a673d5c108a0211d27 Mon Sep 17 00:00:00 2001 From: Tim van der Lippe Date: Fri, 1 Sep 2017 17:44:35 -0700 Subject: [PATCH] Explicitly set display none on dom-* elements (#4821) --- lib/elements/dom-bind.html | 1 + lib/elements/dom-if.html | 1 + lib/elements/dom-repeat.html | 1 + test/smoke/dom-if.html | 61 ++++++++++++++++++++++++++++++++++++ 4 files changed, 64 insertions(+) create mode 100644 test/smoke/dom-if.html diff --git a/lib/elements/dom-bind.html b/lib/elements/dom-bind.html index 158d17d100..508cfa79aa 100644 --- a/lib/elements/dom-bind.html +++ b/lib/elements/dom-bind.html @@ -67,6 +67,7 @@ } connectedCallback() { + this.style.display = 'none'; this.render(); } diff --git a/lib/elements/dom-if.html b/lib/elements/dom-if.html index a1903b0dc5..47150cdec2 100644 --- a/lib/elements/dom-if.html +++ b/lib/elements/dom-if.html @@ -128,6 +128,7 @@ connectedCallback() { super.connectedCallback(); + this.style.display = 'none'; if (this.if) { this.__debounceRender(); } diff --git a/lib/elements/dom-repeat.html b/lib/elements/dom-repeat.html index e6c6882149..aa2ad94b7c 100644 --- a/lib/elements/dom-repeat.html +++ b/lib/elements/dom-repeat.html @@ -302,6 +302,7 @@ connectedCallback() { super.connectedCallback(); + this.style.display = 'none'; // only perform attachment if the element was previously detached. if (this.__isDetached) { this.__isDetached = false; diff --git a/test/smoke/dom-if.html b/test/smoke/dom-if.html new file mode 100644 index 0000000000..84b1aacb8c --- /dev/null +++ b/test/smoke/dom-if.html @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file