/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {isDevMode} from '@angular/core'; import {DomAdapter, getDOM} from '../dom/dom_adapter'; import {DOCUMENT} from '../dom/dom_tokens'; import {sanitizeSrcset, sanitizeUrl} from './url_sanitizer'; /** A element that can be safely used to parse untrusted HTML. Lazily initialized below. */ let inertElement: HTMLElement = null; /** Lazily initialized to make sure the DOM adapter gets set before use. */ let DOM: DomAdapter = null; /** Returns an HTML element that is guaranteed to not execute code when creating elements in it. */ function getInertElement() { if (inertElement) return inertElement; DOM = getDOM(); // Prefer using