dompurify 2.5.1 → 2.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/purify.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! @license DOMPurify 2.5.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.5.1/LICENSE */
1
+ /*! @license DOMPurify 2.5.2 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.5.2/LICENSE */
2
2
 
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -287,7 +287,7 @@
287
287
  * Version label, exposed for easier checks
288
288
  * if DOMPurify is up to date or not
289
289
  */
290
- DOMPurify.version = '2.5.1';
290
+ DOMPurify.version = '2.5.2';
291
291
 
292
292
  /**
293
293
  * Array of elements that DOMPurify removed during sanitation.
@@ -677,7 +677,7 @@
677
677
  CONFIG = cfg;
678
678
  };
679
679
  var MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ['mi', 'mo', 'mn', 'ms', 'mtext']);
680
- var HTML_INTEGRATION_POINTS = addToSet({}, ['foreignobject', 'desc', 'title', 'annotation-xml']);
680
+ var HTML_INTEGRATION_POINTS = addToSet({}, ['foreignobject', 'annotation-xml']);
681
681
 
682
682
  // Certain elements are allowed in both SVG and HTML
683
683
  // namespace. We need to specify them explicitly
@@ -1248,15 +1248,16 @@
1248
1248
  if (_sanitizeElements(shadowNode)) {
1249
1249
  continue;
1250
1250
  }
1251
+ var parentNode = getParentNode(shadowNode);
1251
1252
 
1252
1253
  /* Set the nesting depth of an element */
1253
1254
  if (shadowNode.nodeType === 1) {
1254
- if (shadowNode.parentNode && shadowNode.parentNode.__depth) {
1255
+ if (parentNode && parentNode.__depth) {
1255
1256
  /*
1256
1257
  We want the depth of the node in the original tree, which can
1257
1258
  change when it's removed from its parent.
1258
1259
  */
1259
- shadowNode.__depth = (shadowNode.__removalCount || 0) + shadowNode.parentNode.__depth + 1;
1260
+ shadowNode.__depth = (shadowNode.__removalCount || 0) + parentNode.__depth + 1;
1260
1261
  } else {
1261
1262
  shadowNode.__depth = 1;
1262
1263
  }
@@ -1399,15 +1400,16 @@
1399
1400
  if (_sanitizeElements(currentNode)) {
1400
1401
  continue;
1401
1402
  }
1403
+ var parentNode = getParentNode(currentNode);
1402
1404
 
1403
1405
  /* Set the nesting depth of an element */
1404
1406
  if (currentNode.nodeType === 1) {
1405
- if (currentNode.parentNode && currentNode.parentNode.__depth) {
1407
+ if (parentNode && parentNode.__depth) {
1406
1408
  /*
1407
1409
  We want the depth of the node in the original tree, which can
1408
1410
  change when it's removed from its parent.
1409
1411
  */
1410
- currentNode.__depth = (currentNode.__removalCount || 0) + currentNode.parentNode.__depth + 1;
1412
+ currentNode.__depth = (currentNode.__removalCount || 0) + parentNode.__depth + 1;
1411
1413
  } else {
1412
1414
  currentNode.__depth = 1;
1413
1415
  }