From 87e312f1d72366f35028d742acd028929106501f Mon Sep 17 00:00:00 2001 From: Daniel Freedman Date: Mon, 14 Nov 2016 17:35:23 -0800 Subject: [PATCH] Make sure text nodes are distributed when translating slot to content Fixes #4109 --- src/lib/annotations/annotations.html | 5 +++-- test/unit/polymer-dom-content.html | 7 +++++-- test/unit/styling-scoped-elements.html | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/lib/annotations/annotations.html b/src/lib/annotations/annotations.html index 438d4fdc21..1974b03fdb 100644 --- a/src/lib/annotations/annotations.html +++ b/src/lib/annotations/annotations.html @@ -281,8 +281,9 @@ content.setAttribute(attr.name, attr.value); } var name = slot.getAttribute('name'); - var select = name ? '[slot=\'' + name + '\']' : ':not([slot])'; - content.setAttribute('select', select); + if (name) { + content.setAttribute('select', '[slot=\'' + name + '\']'); + } slot.parentNode.replaceChild(content, slot); return content; }, diff --git a/test/unit/polymer-dom-content.html b/test/unit/polymer-dom-content.html index 2a70eaeb9f..63ae8fd642 100644 --- a/test/unit/polymer-dom-content.html +++ b/test/unit/polymer-dom-content.html @@ -32,8 +32,8 @@