From acfef71d0fb98351675df9b4cee93ef254ea98d0 Mon Sep 17 00:00:00 2001 From: Tim van der Lippe Date: Fri, 16 Mar 2018 16:15:12 +0100 Subject: [PATCH] Deduplicate style includes --- lib/utils/style-gather.html | 2 +- test/unit/styling-scoped.html | 50 +++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 1 deletion(-) diff --git a/lib/utils/style-gather.html b/lib/utils/style-gather.html index 5c4fa8ceb6..d4a141e981 100644 --- a/lib/utils/style-gather.html +++ b/lib/utils/style-gather.html @@ -123,7 +123,7 @@ // other dom-modules that contain styling let include = e.getAttribute(INCLUDE_ATTR); if (include) { - styles.push(...this.stylesFromModules(include)); + styles.push(...new Set(this.stylesFromModules(include))); } if (baseURI) { e.textContent = Polymer.ResolveUrl.resolveCss(e.textContent, baseURI); diff --git a/test/unit/styling-scoped.html b/test/unit/styling-scoped.html index aefc3891f7..a6cc007773 100644 --- a/test/unit/styling-scoped.html +++ b/test/unit/styling-scoped.html @@ -729,6 +729,37 @@ + + + + + + + + + + + + +