Skip to content

Commit bb5aa18

Browse files
bmeurerDevtools-frontend LUCI CQ
authored andcommitted
UI Eng Vision: createElement in ConsoleFormat.ts is safe.
Fixed: 407750620 Change-Id: I50125c6c9cd13df558fba295bd65d4702714609f Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6939234 Auto-Submit: Benedikt Meurer <[email protected]> Reviewed-by: Ergün Erdoğmuş <[email protected]> Commit-Queue: Ergün Erdoğmuş <[email protected]> Commit-Queue: Benedikt Meurer <[email protected]>
1 parent d50dcd0 commit bb5aa18

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

front_end/panels/console/ConsoleFormat.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Copyright 2021 The Chromium Authors. All rights reserved.
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
4-
/* eslint-disable rulesdir/no-imperative-dom-api */
54

65
import * as Common from '../../core/common/common.js';
76
import type * as Platform from '../../core/platform/platform.js';
@@ -207,6 +206,10 @@ export const updateStyle = (currentStyle: Map<string, {value: string, priority:
207206
const URL_REGEX = /url\([\'\"]?([^\)]*)/g;
208207

209208
currentStyle.clear();
209+
/* eslint-disable-next-line rulesdir/no-imperative-dom-api --
210+
* We're not mutating the DOM here, but just need a temporary
211+
* `<span>` to parse `styleToAdd` into a `CSSStyleDeclaration`.
212+
**/
210213
const buffer = document.createElement('span');
211214
buffer.setAttribute('style', styleToAdd);
212215
for (const property of buffer.style) {

0 commit comments

Comments
 (0)