From 218fb796646c92c74f4a10876a52e7103e8e79c2 Mon Sep 17 00:00:00 2001 From: Steven Orvell Date: Fri, 22 May 2015 18:26:02 -0700 Subject: [PATCH] Make `dom-bind` not scope element classes. Fixes #1542 --- src/lib/template/dom-bind.html | 10 ++++++++++ test/unit/styling-scoped.html | 14 ++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/src/lib/template/dom-bind.html b/src/lib/template/dom-bind.html index 8eab5ceb80..fdb3ec1140 100644 --- a/src/lib/template/dom-bind.html +++ b/src/lib/template/dom-bind.html @@ -95,6 +95,16 @@ // where template content is filled in after creation }, + // avoid scoping elements as we expect dom-bind output to be in the main + // document + _scopeElementClass: function(element, selector) { + if (this.dataHost) { + return this.dataHost._scopeElementClass(element, selector); + } else { + return selector; + } + }, + attached: function() { if (!this._children) { this._template = this; diff --git a/test/unit/styling-scoped.html b/test/unit/styling-scoped.html index 7356f05b11..e99e76e87f 100644 --- a/test/unit/styling-scoped.html +++ b/test/unit/styling-scoped.html @@ -38,6 +38,11 @@ + +