Replace single class invocations of createElementWithClass
This applies the following replacement to the codebase:
(\S+) = createElementWithClass\('(\w+)', '([^'\s]+)'\);
to
$1 = document.createElement('$2');\n$1.classList.add('$3');
[email protected]
No-Presubmit: true
Bug: 1011811, 1077215
Change-Id: I0d76b39f1ed8cd4a44f18f94e398db934ba4b09c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2176112
Commit-Queue: Tim van der Lippe <[email protected]>
Reviewed-by: Paul Lewis <[email protected]>
diff --git a/front_end/settings/FrameworkBlackboxSettingsTab.js b/front_end/settings/FrameworkBlackboxSettingsTab.js
index 4eeae3f..b0ad6bb 100644
--- a/front_end/settings/FrameworkBlackboxSettingsTab.js
+++ b/front_end/settings/FrameworkBlackboxSettingsTab.js
@@ -32,7 +32,8 @@
this._list.element.classList.add('blackbox-list');
this._list.registerRequiredCSS('settings/frameworkBlackboxSettingsTab.css');
- const placeholder = createElementWithClass('div', 'blackbox-list-empty');
+ const placeholder = document.createElement('div');
+ placeholder.classList.add('blackbox-list-empty');
placeholder.textContent = Common.UIString.UIString('No blackboxed patterns');
this._list.setEmptyPlaceholder(placeholder);
this._list.show(this.contentElement);
@@ -73,7 +74,8 @@
* @return {!Element}
*/
renderItem(item, editable) {
- const element = createElementWithClass('div', 'blackbox-list-item');
+ const element = document.createElement('div');
+ element.classList.add('blackbox-list-item');
const pattern = element.createChild('div', 'blackbox-pattern');
pattern.textContent = item.pattern;
pattern.title = ls`Blackbox scripts whose names match '${item.pattern}'`;