Skip to content

Commit

Permalink
Use cssText for writing style
Browse files Browse the repository at this point in the history
  • Loading branch information
lauriro committed Jul 3, 2024
1 parent b621d1c commit 6c173ce
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ var boolAttrs = {
return this._style || (this._style = new CSSStyleDeclaration(this.getAttribute("style") || ""))
},
set style(value) {
this.setAttribute("style", value)
this.style.cssText = value
},
contains: function (el) {
for (; el; el = el.parentNode) if (el === this) return true
Expand Down Expand Up @@ -288,7 +288,6 @@ NamedNodeMap.prototype = {
if (loName === "style" && this.ownerElement._style) {
if (attr === null) attr = this[loName] = new Attr(this.ownerElement, name, "")
attr.value = this.ownerElement._style.cssText
delete this.ownerElement._style
}
return attr
},
Expand Down

0 comments on commit 6c173ce

Please sign in to comment.