diff --git a/packages/core/src/sanitization/inert_body.ts b/packages/core/src/sanitization/inert_body.ts
index 46f76eb8f4..e859f8af5a 100644
--- a/packages/core/src/sanitization/inert_body.ts
+++ b/packages/core/src/sanitization/inert_body.ts
@@ -9,49 +9,26 @@
/**
* This helper class is used to get hold of an inert tree of DOM elements containing dirty HTML
* that needs sanitizing.
- * Depending upon browser support we must use one of three strategies for doing this.
- * Support: Safari 10.x -> XHR strategy
- * Support: Firefox -> DomParser strategy
- * Default: InertDocument strategy
+ * Depending upon browser support we use one of two strategies for doing this.
+ * Default: DomParser strategy
+ * Fallback: InertDocument strategy
*/
export class InertBodyHelper {
private inertDocument: Document;
constructor(private defaultDoc: Document) {
this.inertDocument = this.defaultDoc.implementation.createHTMLDocument('sanitization-inert');
- let inertBodyElement = this.inertDocument.body;
-
- if (inertBodyElement == null) {
+ if (this.inertDocument.body == null) {
// usually there should be only one body element in the document, but IE doesn't have any, so
// we need to create one.
const inertHtml = this.inertDocument.createElement('html');
this.inertDocument.appendChild(inertHtml);
- inertBodyElement = this.inertDocument.createElement('body');
+ const inertBodyElement = this.inertDocument.createElement('body');
inertHtml.appendChild(inertBodyElement);
}
- inertBodyElement.innerHTML = '';
- if (inertBodyElement.querySelector && !inertBodyElement.querySelector('svg')) {
- // We just hit the Safari 10.1 bug - which allows JS to run inside the SVG G element
- // so use the XHR strategy.
- this.getInertBodyElement = this.getInertBodyElement_XHR;
- return;
- }
-
- inertBodyElement.innerHTML = '