-
Notifications
You must be signed in to change notification settings - Fork 63
Cooperate with ShadyCSS to appropriately scope changes to class/className #54
Conversation
Conflicts: shadydom.min.js shadydom.min.js.map
@@ -371,6 +350,14 @@ let nativeImportNode = Document.prototype.importNode; | |||
let nativeSetAttribute = Element.prototype.setAttribute; | |||
let nativeRemoveAttribute = Element.prototype.removeAttribute; | |||
|
|||
export let setAttribute = function(attr, value) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not take the node as the first argument?
setAttribute(node, attr, value)
would remove the indirection used later.
@@ -656,7 +643,7 @@ let ElementMixin = { | |||
|
|||
|
|||
setAttribute(name, value) { | |||
nativeSetAttribute.call(this, name, value); | |||
setAttribute.call(this, name, value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could be setAttribute(this, name, value)
return this.getAttribute('class'); | ||
}, | ||
set(value) { | ||
setAttribute.call(this, 'class', value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setAttribute(this, 'class', value)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nvm, the setAttribute
function will have to be indirectly called somewhere, better for it to be more performant on the element.setAttribute
case.
…`name` changes, (2) the `slot` attribute changed and the parent has a shadowRoot with insertion point. Previously any attribute change on a patched node would distribute if the parent had a shadowRoot with insertion points.
Implements class/className setters for all elements using ShadyCSS's
setElementClass(element, classString)
api to provide automatic style scoping whenclass
changes.Should not be merged before webcomponents/shadycss#25.