diff --git a/packages/core/src/sanitization/inert_body.ts b/packages/core/src/sanitization/inert_body.ts
index 18bc74bd21..37fc574b66 100644
--- a/packages/core/src/sanitization/inert_body.ts
+++ b/packages/core/src/sanitization/inert_body.ts
@@ -15,33 +15,31 @@
* Default: InertDocument strategy
*/
export class InertBodyHelper {
- private inertBodyElement: HTMLElement;
private inertDocument: Document;
constructor(private defaultDoc: Document) {
this.inertDocument = this.defaultDoc.implementation.createHTMLDocument('sanitization-inert');
- this.inertBodyElement = this.inertDocument.body;
+ let inertBodyElement = this.inertDocument.body;
- if (this.inertBodyElement == null) {
+ if (inertBodyElement == 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);
- this.inertBodyElement = this.inertDocument.createElement('body');
- inertHtml.appendChild(this.inertBodyElement);
+ inertBodyElement = this.inertDocument.createElement('body');
+ inertHtml.appendChild(inertBodyElement);
}
- this.inertBodyElement.innerHTML = '';
- if (this.inertBodyElement.querySelector && !this.inertBodyElement.querySelector('svg')) {
+ 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;
}
- this.inertBodyElement.innerHTML =
- '