Skip to content

Commit 8e29990

Browse files
committed
fix: Made use of proper helper method to get parentNode
test: fixed several more MSIE11 tests
1 parent 7e3a705 commit 8e29990

File tree

11 files changed

+13
-13
lines changed

11 files changed

+13
-13
lines changed

dist/purify.cjs.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/purify.cjs.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/purify.es.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/purify.es.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/purify.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/purify.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/purify.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/purify.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/purify.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ function createDOMPurify(window = getGlobal()) {
507507
* return. Return true otherwise.
508508
*/
509509
const _checkValidNamespace = function (element) {
510-
let parent = element.parentNode;
510+
let parent = getParentNode(element);
511511

512512
// In JSDOM, if we're inside shadow DOM, then parentNode
513513
// can be null. We just simulate parent in this case.

test/fixtures/expect.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,7 +1022,7 @@ module.exports = [
10221022
"<svg></svg><p></p><title>&lt;a id=\"</title><img src=\"x\">\"&gt;",
10231023
"<svg><title><a id=\"</title><img src=x onerror=alert()>\"></a></title></svg>",
10241024
"<svg xmlns=\"http://www.w3.org/2000/svg\"><title><a id=\"</title><img src=x onerror=alert()>\"></a></title></svg>",
1025-
"<svg xmlns=\"http://www.w3.org/2000/svg\" />"
1025+
"<svg xmlns=\"http://www.w3.org/2000/svg\"><title><a id=\"</title><img src=x onerror=alert()>\"></a></title></title></svg></svg>"
10261026
]
10271027
}, {
10281028
"title": "Tests against mXSS behavior with MathML in Chrome 77 and alike",
@@ -1042,7 +1042,7 @@ module.exports = [
10421042
"<svg></svg><p></p><img src=\"x\">",
10431043
"<svg><title><template></template></title></svg>",
10441044
"<svg xmlns=\"http://www.w3.org/2000/svg\"><title><template></template></title></svg>",
1045-
"<svg xmlns=\"http://www.w3.org/2000/svg\" />"
1045+
"<svg xmlns=\"http://www.w3.org/2000/svg\"><title><template></template></title></title></svg></svg>"
10461046
]
10471047
}, {
10481048
"title": "Tests against mXSS behavior with MathML Templates in Chrome 77 and alike",

0 commit comments

Comments
 (0)