Skip to content

Commit

Permalink
Do not minimize element style by default
Browse files Browse the repository at this point in the history
  • Loading branch information
lauriro committed Jan 4, 2025
1 parent c72df58 commit b3c8dfb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,6 @@ NamedNodeMap.prototype = {
},
setNamedItem(attr) {
var oldAttr = this.getNamedItem(attr.name)
if (attr.name === "style") attr.value = CSSStyleDeclaration(attr.value).cssText
this[attr.name] = attr
return oldAttr
},
Expand All @@ -303,6 +302,7 @@ NamedNodeMap.prototype = {
, tagName = map.ownerElement.tagName
, isXml = map.ownerElement.ownerDocument.contentType === "application/xml"
return map.names().map(loName => {
if (loName === "style" && minify && map.ownerElement.style) {} // Access to style makes _style
var attr = map.getNamedItem(loName)
, name = attr.name
, value = attr.value.replace(escRe, escFn)
Expand Down
2 changes: 1 addition & 1 deletion test/data/ui/index.html.snap
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if (a > 12) throw "a <\!---->not <\!-- --> 12"
<body onload="
console.log('&quot;code&quot;');
" class="reset page"><!-- table -->
<ul class="gr" style="background-image:url(https://1.1.1.1:80/i.png);height:365px">
<ul class="gr" style="background-image: url('https://1.1.1.1:80/i.png');height :365px">
<li class=" a clc b "> Some
<b> bold </b> text here
</li>
Expand Down
2 changes: 1 addition & 1 deletion test/data/ui/index.html.snap2
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if (a > 12) throw "a <\!---->not <\!-- --> 12"
<body onload="
console.log('&quot;code&quot;');
" class="reset page"><!-- table -->
<ul class="gr" style="background-image:url(https://1.1.1.1:80/i.png);height:365px">
<ul class="gr" style="background-image: url('https://1.1.1.1:80/i.png');height :365px">
<li class=" a clc b "> Some
<b> bold </b> text here
</li>
Expand Down

0 comments on commit b3c8dfb

Please sign in to comment.