Skip to content

Commit adeebfa

Browse files
committed
test: Fixed several tests to align with Firefox 140 behavior
1 parent 0e312f8 commit adeebfa

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

test/fixtures/expect.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,8 @@ export default [
723723
"expected": [
724724
"<div id=\"134\">\n<img alt=\"%></xmp><img src=xx onerror=alert(134)//\">\n\n %&gt;/\nalert(2)\n\n\nXXX\n<style>\n*['<!--']{}\n</style>\n--&gt;{}\n*{color:red}//[\"'`--&gt;]]&gt;]</div>",
725725
"<div id=\"134\">\n<img alt=\"%&gt;&lt;/xmp&gt;&lt;img src=xx onerror=alert(134)//\">\n\n %&gt;/\nalert(2)\n\n\nXXX\n<style>\n*['<!--']{}\n</style>\n-&gt;{}\n*{color:red}//[\"'`--&gt;]]&gt;]</div>",
726-
"<div id=\"134\">\n<img alt=\"%></xmp><img src=xx onerror=alert(134)//\">\n\n %&gt;/\nalert(2)\n\n\nXXX\n\n--&gt;{}\n*{color:red}//[\"'`--&gt;]]&gt;]</div>"
726+
"<div id=\"134\">\n<img alt=\"%></xmp><img src=xx onerror=alert(134)//\">\n\n %&gt;/\nalert(2)\n\n\nXXX\n\n--&gt;{}\n*{color:red}//[\"'`--&gt;]]&gt;]</div>",
727+
"<div id=\"134\">\n<img alt=\"%&gt;&lt;/xmp&gt;&lt;img src=xx onerror=alert(134)//\">\n\n %&gt;/\nalert(2)\n\n\nXXX\n\n--&gt;{}\n*{color:red}//[\"'`--&gt;]]&gt;]</div>"
727728
]
728729
}, {
729730
"title": "SVG",

test/test-suite.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,11 @@
141141
}),
142142
'<a href="#">abc</a>'
143143
);
144-
assert.equal(
144+
assert.contains(
145145
DOMPurify.sanitize('<a href="#" class="foo <br/>">abc</a>', {
146146
ALLOW_SELF_CLOSE_IN_ATTR: true,
147147
}),
148-
'<a href="#" class="foo <br/>">abc</a>'
148+
['<a href="#" class="foo <br/>">abc</a>', "<a href=\"#\" class=\"foo &lt;br/&gt;\">abc</a>"]
149149
);
150150
});
151151
QUnit.test('Config-Flag tests: ALLOW_DATA_ATTR', function (assert) {
@@ -1701,6 +1701,7 @@
17011701
'<img y="<x">',
17021702
'<img y="&lt;x">',
17031703
'<img y="<x">',
1704+
"<img x=\"/&gt;&lt;img src=x onerror=alert(1)&gt;\" y=\"&lt;x\">",
17041705
]);
17051706
}
17061707
);

0 commit comments

Comments
 (0)