From a0b83b259f23277419ef1b71bb8dc19093dd20a4 Mon Sep 17 00:00:00 2001 From: Daniel Freedman Date: Fri, 3 May 2019 16:27:54 -0700 Subject: [PATCH 1/2] Fix class$ bindings for ShadyDOM.noPatch mode --- lib/mixins/properties-changed.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/mixins/properties-changed.js b/lib/mixins/properties-changed.js index 94147a436c..b81844b828 100644 --- a/lib/mixins/properties-changed.js +++ b/lib/mixins/properties-changed.js @@ -497,12 +497,12 @@ export const PropertiesChanged = dedupingMixin( */ _valueToNodeAttribute(node, value, attribute) { const str = this._serializeValue(value); + if (attribute === 'class' || attribute === 'name' || attribute === 'slot') { + node = /** @type {?Element} */(wrap(node)); + } if (str === undefined) { node.removeAttribute(attribute); } else { - if (attribute === 'class' || attribute === 'name' || attribute === 'slot') { - node = /** @type {?Element} */(wrap(node)); - } node.setAttribute(attribute, str); } } From 8043d4c11f5bd2c7419c6b6994717ad480eb68a5 Mon Sep 17 00:00:00 2001 From: Daniel Freedman Date: Fri, 3 May 2019 16:49:32 -0700 Subject: [PATCH 2/2] Add test for class$ binding --- test/unit/styling-scoped.html | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/test/unit/styling-scoped.html b/test/unit/styling-scoped.html index d3a429006b..696cab84bf 100644 --- a/test/unit/styling-scoped.html +++ b/test/unit/styling-scoped.html @@ -729,6 +729,31 @@ + +