Introduce enableLegacyPatching flag for CSS patching
As part of the dark mode migration we are adding
`enableLegacyPatching:true` to all call sites of `appendStyle` (and
related methods). If a user passes `false` for that flag, no CSS colour
patching will occur.
This CL is therefore a no-op from a user's perspective as we pass `true`
on every call to maintain existing behaviour, but once we start
migrating we will turn the option to `false`. Long term, once all code
is migrated and the old patching is removed, we will remove this flag
entirely once again.
Bug: 1122511
Change-Id: I76b818e83b7d5ee0175e1548759373f53481e0ab
No-Presubmit: True
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2516345
Commit-Queue: Jack Franklin <[email protected]>
Reviewed-by: Tim van der Lippe <[email protected]>
diff --git a/front_end/network/BlockedURLsPane.js b/front_end/network/BlockedURLsPane.js
index 999f606..91fe797 100644
--- a/front_end/network/BlockedURLsPane.js
+++ b/front_end/network/BlockedURLsPane.js
@@ -15,7 +15,7 @@
export class BlockedURLsPane extends UI.Widget.VBox {
constructor() {
super(true);
- this.registerRequiredCSS('network/blockedURLsPane.css');
+ this.registerRequiredCSS('network/blockedURLsPane.css', {enableLegacyPatching: true});
_instance = this;
this._manager = SDK.NetworkManager.MultitargetNetworkManager.instance();
@@ -39,7 +39,7 @@
/** @type {!UI.ListWidget.ListWidget<!SDK.NetworkManager.BlockedPattern>} */
this._list = new UI.ListWidget.ListWidget(this);
this._list.element.classList.add('blocked-urls');
- this._list.registerRequiredCSS('network/blockedURLsPane.css');
+ this._list.registerRequiredCSS('network/blockedURLsPane.css', {enableLegacyPatching: true});
this._list.setEmptyPlaceholder(this._createEmptyPlaceholder());
this._list.show(this.contentElement);