From 690838abdecf41b2a4a424cf5ae245fd00ec6677 Mon Sep 17 00:00:00 2001 From: Daniel Freedman Date: Tue, 24 Nov 2015 12:18:17 -0800 Subject: [PATCH] set class attribute instead of using classname Fixes #2407 add test with dynamic svg elements Test for fill-opacity, it doesn't get munged like color Most browsers don't like CSS for sizing the circle :( --- src/standard/styling.html | 8 ++++-- test/unit/styling-scoped-elements.html | 39 +++++++++++++++++++++++++- test/unit/styling-scoped.html | 24 ++++++++++++---- 3 files changed, 62 insertions(+), 9 deletions(-) diff --git a/src/standard/styling.html b/src/standard/styling.html index f4fa704dbe..35b03b8b83 100644 --- a/src/standard/styling.html +++ b/src/standard/styling.html @@ -68,7 +68,7 @@ } } cssText += styleUtil.cssFromModule(this.is); - // check if we have a disconnected template and add styles from that + // check if we have a disconnected template and add styles from that // if so; if our template has no parent or is not in our dom-module... var p = this._template && this._template.parentNode; if (this._template && (!p || p.id.toLowerCase() !== this.is)) { @@ -129,10 +129,12 @@ var self = this; var scopify = function(node) { if (node.nodeType === Node.ELEMENT_NODE) { - node.className = self._scopeElementClass(node, node.className); + var className = node.getAttribute('class'); + node.setAttribute('class', self._scopeElementClass(node, className)); var n$ = node.querySelectorAll('*'); for (var i=0, n; (i \ No newline at end of file + + + + + + + + diff --git a/test/unit/styling-scoped.html b/test/unit/styling-scoped.html index e445fa09d6..c2a4157044 100644 --- a/test/unit/styling-scoped.html +++ b/test/unit/styling-scoped.html @@ -43,6 +43,8 @@ [[dynamic]] + +