chrome-devtools-frontend 1.0.1582745 → 1.0.1585538
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/front_end/core/host/InspectorFrontendHostAPI.ts +1 -0
- package/front_end/core/host/InspectorFrontendHostStub.ts +2 -0
- package/front_end/core/root/Runtime.ts +12 -11
- package/front_end/core/sdk/CSSMatchedStyles.ts +3 -0
- package/front_end/core/sdk/CSSMetadata.ts +3 -0
- package/front_end/core/sdk/NetworkManager.ts +63 -115
- package/front_end/entrypoint_template.html +1 -5
- package/front_end/entrypoints/main/MainImpl.ts +1 -0
- package/front_end/generated/Deprecation.ts +21 -0
- package/front_end/generated/InspectorBackendCommands.ts +5 -3
- package/front_end/generated/SupportedCSSProperties.js +6 -2
- package/front_end/generated/protocol-mapping.d.ts +2 -1
- package/front_end/generated/protocol-proxy-api.d.ts +2 -1
- package/front_end/generated/protocol.ts +14 -0
- package/front_end/models/ai_assistance/AiConversation.ts +34 -2
- package/front_end/models/ai_assistance/BuiltInAi.ts +1 -2
- package/front_end/models/ai_assistance/agents/AiAgent.ts +3 -10
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.snapshot.txt +1 -1
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +17 -9
- package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +0 -24
- package/front_end/models/ai_code_generation/AiCodeGeneration.ts +5 -0
- package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +16 -8
- package/front_end/models/computed_style/ComputedStyleModel.ts +20 -15
- package/front_end/models/greendev/Prototypes.ts +1 -5
- package/front_end/models/issues_manager/CorsIssue.ts +2 -9
- package/front_end/models/issues_manager/descriptions/corsLocalNetworkAccessPermissionDenied.md +2 -2
- package/front_end/models/javascript_metadata/NativeFunctions.js +20 -0
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +28 -39
- package/front_end/panels/ai_assistance/components/ChatInput.ts +73 -95
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +4 -2
- package/front_end/panels/ai_assistance/components/ChatView.ts +0 -2
- package/front_end/panels/autofill/AutofillView.ts +4 -8
- package/front_end/panels/common/AiCodeGenerationTeaser.ts +37 -8
- package/front_end/panels/console/ConsoleView.ts +1 -2
- package/front_end/panels/console/ConsoleViewMessage.ts +18 -11
- package/front_end/panels/elements/ComputedStyleWidget.ts +80 -48
- package/front_end/panels/elements/ElementStatePaneWidget.ts +1 -1
- package/front_end/panels/elements/ElementsPanel.ts +18 -5
- package/front_end/panels/elements/ElementsTreeElement.ts +459 -435
- package/front_end/panels/elements/EventListenersWidget.ts +2 -4
- package/front_end/panels/elements/NodeStackTraceWidget.ts +1 -3
- package/front_end/panels/elements/PropertiesWidget.ts +1 -2
- package/front_end/panels/elements/StylePropertyTreeElement.ts +18 -2
- package/front_end/panels/elements/computedStyleWidget.css +25 -0
- package/front_end/panels/issues/AffectedResourcesView.ts +1 -2
- package/front_end/panels/network/NetworkDataGridNode.ts +0 -8
- package/front_end/panels/network/NetworkLogView.ts +64 -105
- package/front_end/panels/network/RequestConditionsDrawer.ts +168 -233
- package/front_end/panels/network/network-meta.ts +4 -27
- package/front_end/panels/settings/SettingsScreen.ts +12 -4
- package/front_end/panels/settings/WorkspaceSettingsTab.ts +1 -1
- package/front_end/panels/snippets/SnippetsQuickOpen.ts +6 -9
- package/front_end/panels/sources/CallStackSidebarPane.ts +6 -8
- package/front_end/panels/sources/DebuggerPlugin.ts +2 -1
- package/front_end/panels/sources/GoToLineQuickOpen.ts +0 -4
- package/front_end/panels/sources/OpenFileQuickOpen.ts +0 -4
- package/front_end/panels/sources/OutlineQuickOpen.ts +0 -4
- package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +3 -1
- package/front_end/panels/sources/sources-meta.ts +9 -6
- package/front_end/panels/timeline/TimelineFlameChartView.ts +0 -12
- package/front_end/panels/timeline/TimelinePanel.ts +35 -15
- package/front_end/panels/timeline/components/Sidebar.ts +21 -0
- package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +1 -20
- package/front_end/panels/timeline/components/insights/InsightRenderer.ts +0 -1
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/puppeteer/README.chromium +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.js +2 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/encoding.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/encoding.js +5 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/encoding.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +8 -6
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.js +2 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/encoding.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/encoding.js +5 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/encoding.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/package.json +4 -4
- package/front_end/third_party/puppeteer/package/src/bidi/Page.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/bidi/core/BrowsingContext.ts +2 -2
- package/front_end/third_party/puppeteer/package/src/node/ChromeLauncher.ts +4 -3
- package/front_end/third_party/puppeteer/package/src/revisions.ts +2 -2
- package/front_end/third_party/puppeteer/package/src/util/encoding.ts +5 -3
- package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
- package/front_end/ui/components/linkifier/LinkifierImpl.ts +3 -0
- package/front_end/ui/components/linkifier/LinkifierUtils.ts +3 -0
- package/front_end/ui/components/text_editor/AiCodeCompletionProvider.ts +8 -0
- package/front_end/ui/components/text_editor/AiCodeGenerationParser.ts +29 -7
- package/front_end/ui/components/text_editor/AiCodeGenerationProvider.ts +42 -18
- package/front_end/ui/components/text_editor/config.ts +6 -0
- package/front_end/ui/legacy/InspectorView.ts +41 -15
- package/front_end/ui/legacy/Toolbar.ts +12 -4
- package/front_end/ui/legacy/UIUtils.ts +56 -7
- package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +4 -3
- package/front_end/ui/legacy/components/quick_open/FilteredListWidget.ts +2 -1
- package/front_end/ui/legacy/components/quick_open/HelpQuickOpen.ts +8 -2
- package/front_end/ui/legacy/components/quick_open/QuickOpen.ts +8 -8
- package/front_end/ui/legacy/components/utils/JSPresentationUtils.ts +12 -9
- package/front_end/ui/legacy/components/utils/Linkifier.ts +116 -87
- package/front_end/ui/legacy/legacy.ts +0 -2
- package/front_end/ui/visual_logging/KnownContextValues.ts +4 -0
- package/mcp/HostBindings.ts +3 -0
- package/package.json +1 -1
- package/front_end/models/issues_manager/descriptions/corsInsecurePrivateNetwork.md +0 -10
- package/front_end/models/issues_manager/descriptions/corsPreflightAllowPrivateNetworkError.md +0 -10
- package/front_end/models/issues_manager/descriptions/corsPrivateNetworkPermissionDenied.md +0 -10
- package/front_end/panels/elements/computedStyleSidebarPane.css +0 -18
- package/front_end/ui/legacy/Floaty.ts +0 -438
- package/front_end/ui/legacy/floaty.css +0 -77
|
@@ -702,15 +702,27 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
|
|
|
702
702
|
clickableElement.tabIndex = -1;
|
|
703
703
|
}
|
|
704
704
|
clickableElement.appendChild(messageElement);
|
|
705
|
-
const stackTraceElement = contentElement.createChild('div');
|
|
705
|
+
const stackTraceElement = contentElement.createChild('div', 'hidden-stack-trace');
|
|
706
|
+
const targetManager = SDK.TargetManager.TargetManager.instance();
|
|
707
|
+
const stackTraceTarget = target ?? targetManager.primaryPageTarget() ?? targetManager.rootTarget();
|
|
706
708
|
const stackTracePreview = new Components.JSPresentationUtils.StackTracePreviewContent(
|
|
707
|
-
undefined,
|
|
709
|
+
undefined, stackTraceTarget ?? undefined, this.linkifier, {widthConstrained: true});
|
|
710
|
+
if (stackTraceTarget && stackTrace) {
|
|
711
|
+
const selectableChildIndex = this.selectableChildren.length;
|
|
712
|
+
void Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance()
|
|
713
|
+
.createStackTraceFromProtocolRuntime(stackTrace, stackTraceTarget)
|
|
714
|
+
.then(stackTrace => {
|
|
715
|
+
stackTracePreview.stackTrace = stackTrace;
|
|
716
|
+
return stackTracePreview.updateComplete;
|
|
717
|
+
})
|
|
718
|
+
.then(() => {
|
|
719
|
+
const selectableLinks =
|
|
720
|
+
stackTracePreview.linkElements.map(element => ({element, forceSelect: () => element.focus()}));
|
|
721
|
+
this.selectableChildren.splice(selectableChildIndex, 0, ...selectableLinks);
|
|
722
|
+
});
|
|
723
|
+
}
|
|
708
724
|
stackTracePreview.markAsRoot();
|
|
709
725
|
stackTracePreview.show(stackTraceElement);
|
|
710
|
-
for (const linkElement of stackTracePreview.linkElements) {
|
|
711
|
-
this.selectableChildren.push({element: linkElement, forceSelect: () => linkElement.focus()});
|
|
712
|
-
}
|
|
713
|
-
stackTraceElement.classList.add('hidden-stack-trace');
|
|
714
726
|
UI.ARIAUtils.setLabel(
|
|
715
727
|
contentElement, `${messageElement.textContent} ${i18nString(UIStrings.stackMessageCollapsed)}`);
|
|
716
728
|
UI.ARIAUtils.markAsGroup(stackTraceElement);
|
|
@@ -2351,11 +2363,6 @@ export class ConsoleTableMessageView extends ConsoleViewMessage {
|
|
|
2351
2363
|
*/
|
|
2352
2364
|
const MaxLengthToIgnoreHighlighter = 10000;
|
|
2353
2365
|
|
|
2354
|
-
/**
|
|
2355
|
-
* @constant
|
|
2356
|
-
*/
|
|
2357
|
-
export const MaxLengthForLinks = 40;
|
|
2358
|
-
|
|
2359
2366
|
let maxTokenizableStringLength = 10000;
|
|
2360
2367
|
let longStringVisibleLength = 5000;
|
|
2361
2368
|
|
|
@@ -38,7 +38,7 @@ import * as Common from '../../core/common/common.js';
|
|
|
38
38
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
39
39
|
import * as Platform from '../../core/platform/platform.js';
|
|
40
40
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
41
|
-
import * as ComputedStyleModule from '../../models/computed_style/computed_style.js';
|
|
41
|
+
import type * as ComputedStyleModule from '../../models/computed_style/computed_style.js';
|
|
42
42
|
import * as TreeOutline from '../../ui/components/tree_outline/tree_outline.js';
|
|
43
43
|
import * as InlineEditor from '../../ui/legacy/components/inline_editor/inline_editor.js';
|
|
44
44
|
import * as Components from '../../ui/legacy/components/utils/utils.js';
|
|
@@ -46,7 +46,7 @@ import * as UI from '../../ui/legacy/legacy.js';
|
|
|
46
46
|
import * as Lit from '../../ui/lit/lit.js';
|
|
47
47
|
|
|
48
48
|
import * as ElementsComponents from './components/components.js';
|
|
49
|
-
import
|
|
49
|
+
import computedStyleWidgetStyles from './computedStyleWidget.css.js';
|
|
50
50
|
import {ImagePreviewPopover} from './ImagePreviewPopover.js';
|
|
51
51
|
import {PlatformFontsWidget} from './PlatformFontsWidget.js';
|
|
52
52
|
import {categorizePropertyName, type Category, DefaultCategoryOrder} from './PropertyNameCategories.js';
|
|
@@ -54,6 +54,7 @@ import {Renderer, rendererBase, type RenderingContext, StringRenderer, URLRender
|
|
|
54
54
|
import {StylePropertiesSection} from './StylePropertiesSection.js';
|
|
55
55
|
|
|
56
56
|
const {html, render} = Lit;
|
|
57
|
+
const {bindToSetting} = UI.UIUtils;
|
|
57
58
|
|
|
58
59
|
const UIStrings = {
|
|
59
60
|
/**
|
|
@@ -263,9 +264,12 @@ type ComputedStyleData = {
|
|
|
263
264
|
|
|
264
265
|
interface ComputedStyleWidgetInput {
|
|
265
266
|
computedStylesTree: TreeOutline.TreeOutline.TreeOutline<ComputedStyleData>;
|
|
266
|
-
toolbar: HTMLElement;
|
|
267
267
|
hasMatches: boolean;
|
|
268
|
-
computedStyleModel
|
|
268
|
+
computedStyleModel?: ComputedStyleModule.ComputedStyleModel.ComputedStyleModel;
|
|
269
|
+
showInheritedComputedStylePropertiesSetting: Common.Settings.Setting<boolean>;
|
|
270
|
+
groupComputedStylesSetting: Common.Settings.Setting<boolean>;
|
|
271
|
+
onFilterChanged: (event: CustomEvent<string>) => void;
|
|
272
|
+
filterText: string;
|
|
269
273
|
}
|
|
270
274
|
|
|
271
275
|
type View = (input: ComputedStyleWidgetInput, output: null, target: HTMLElement) => void;
|
|
@@ -273,23 +277,38 @@ type View = (input: ComputedStyleWidgetInput, output: null, target: HTMLElement)
|
|
|
273
277
|
export const DEFAULT_VIEW: View = (input, _output, target) => {
|
|
274
278
|
// clang-format off
|
|
275
279
|
render(html`
|
|
276
|
-
<
|
|
277
|
-
<div class="
|
|
278
|
-
|
|
280
|
+
<style>${computedStyleWidgetStyles}</style>
|
|
281
|
+
<div class="styles-sidebar-pane-toolbar">
|
|
282
|
+
<devtools-toolbar class="styles-pane-toolbar" role="presentation">
|
|
283
|
+
<devtools-toolbar-input
|
|
284
|
+
type="filter"
|
|
285
|
+
autofocus
|
|
286
|
+
value=${input.filterText}
|
|
287
|
+
@change=${input.onFilterChanged}
|
|
288
|
+
></devtools-toolbar-input>
|
|
289
|
+
<devtools-checkbox
|
|
290
|
+
title=${i18nString(UIStrings.showAll)}
|
|
291
|
+
${bindToSetting(input.showInheritedComputedStylePropertiesSetting)}
|
|
292
|
+
>${i18nString(UIStrings.showAll)}</devtools-checkbox>
|
|
293
|
+
<devtools-checkbox
|
|
294
|
+
title=${i18nString(UIStrings.group)}
|
|
295
|
+
${bindToSetting(input.groupComputedStylesSetting)}
|
|
296
|
+
>${i18nString(UIStrings.group)}</devtools-checkbox>
|
|
297
|
+
</devtools-toolbar>
|
|
279
298
|
</div>
|
|
299
|
+
${input.computedStylesTree}
|
|
280
300
|
${!input.hasMatches ? html`<div class="gray-info-message">${i18nString(UIStrings.noMatchingProperty)}</div>` : ''}
|
|
281
|
-
|
|
282
|
-
<devtools-widget .widgetConfig=${UI.Widget.widgetConfig(PlatformFontsWidget, { sharedModel: input.computedStyleModel})}></devtools-widget>
|
|
283
|
-
</div>
|
|
301
|
+
${input.computedStyleModel ? html`<devtools-widget .widgetConfig=${UI.Widget.widgetConfig(PlatformFontsWidget, { sharedModel: input.computedStyleModel})}></devtools-widget>` : ''}
|
|
284
302
|
`, target);
|
|
285
303
|
// clang-format on
|
|
286
304
|
};
|
|
287
305
|
|
|
288
306
|
export class ComputedStyleWidget extends UI.Widget.VBox {
|
|
289
|
-
|
|
307
|
+
#computedStyleModel?: ComputedStyleModule.ComputedStyleModel.ComputedStyleModel;
|
|
308
|
+
#nodeStyle: ComputedStyleModule.ComputedStyleModel.ComputedStyle|null = null;
|
|
309
|
+
#matchedStyles: SDK.CSSMatchedStyles.CSSMatchedStyles|null = null;
|
|
290
310
|
private readonly showInheritedComputedStylePropertiesSetting: Common.Settings.Setting<boolean>;
|
|
291
311
|
private readonly groupComputedStylesSetting: Common.Settings.Setting<boolean>;
|
|
292
|
-
input: UI.Toolbar.ToolbarInput;
|
|
293
312
|
private filterRegex: RegExp|null;
|
|
294
313
|
private readonly linkifier: Components.Linkifier.Linkifier;
|
|
295
314
|
private readonly imagePreviewPopover: ImagePreviewPopover;
|
|
@@ -297,21 +316,14 @@ export class ComputedStyleWidget extends UI.Widget.VBox {
|
|
|
297
316
|
#computedStylesTree = new TreeOutline.TreeOutline.TreeOutline<ComputedStyleData>();
|
|
298
317
|
#treeData?: TreeOutline.TreeOutline.TreeOutlineData<ComputedStyleData>;
|
|
299
318
|
readonly #view: View;
|
|
300
|
-
|
|
319
|
+
#filterText = '';
|
|
301
320
|
|
|
302
|
-
constructor(
|
|
321
|
+
constructor() {
|
|
303
322
|
super({useShadowDom: true});
|
|
304
323
|
this.#view = DEFAULT_VIEW;
|
|
305
|
-
this.registerRequiredCSS(computedStyleSidebarPaneStyles);
|
|
306
324
|
|
|
307
325
|
this.contentElement.classList.add('styles-sidebar-computed-style-widget');
|
|
308
326
|
|
|
309
|
-
this.computedStyleModel = computedStyleModel;
|
|
310
|
-
this.computedStyleModel.addEventListener(
|
|
311
|
-
ComputedStyleModule.ComputedStyleModel.Events.CSS_MODEL_CHANGED, this.requestUpdate, this);
|
|
312
|
-
this.computedStyleModel.addEventListener(
|
|
313
|
-
ComputedStyleModule.ComputedStyleModel.Events.COMPUTED_STYLE_CHANGED, this.requestUpdate, this);
|
|
314
|
-
|
|
315
327
|
this.showInheritedComputedStylePropertiesSetting =
|
|
316
328
|
Common.Settings.Settings.instance().createSetting('show-inherited-computed-style-properties', false);
|
|
317
329
|
this.showInheritedComputedStylePropertiesSetting.addChangeListener(this.requestUpdate.bind(this));
|
|
@@ -321,32 +333,15 @@ export class ComputedStyleWidget extends UI.Widget.VBox {
|
|
|
321
333
|
this.requestUpdate();
|
|
322
334
|
});
|
|
323
335
|
|
|
324
|
-
this.toolbarElement = document.createElement('div');
|
|
325
|
-
this.toolbarElement.classList.add('hbox', 'styles-sidebar-pane-toolbar');
|
|
326
|
-
const toolbar = document.createElement('devtools-toolbar');
|
|
327
|
-
toolbar.classList.add('styles-pane-toolbar');
|
|
328
|
-
this.toolbarElement.appendChild(toolbar);
|
|
329
|
-
|
|
330
|
-
const filterInput = new UI.Toolbar.ToolbarFilter(undefined, 1, 1, undefined, undefined, false);
|
|
331
|
-
filterInput.addEventListener(UI.Toolbar.ToolbarInput.Event.TEXT_CHANGED, this.onFilterChanged, this);
|
|
332
|
-
toolbar.appendToolbarItem(filterInput);
|
|
333
|
-
this.input = filterInput;
|
|
334
336
|
this.filterRegex = null;
|
|
335
|
-
|
|
336
|
-
toolbar.appendToolbarItem(new UI.Toolbar.ToolbarSettingCheckbox(
|
|
337
|
-
this.showInheritedComputedStylePropertiesSetting, undefined, i18nString(UIStrings.showAll)));
|
|
338
|
-
toolbar.appendToolbarItem(
|
|
339
|
-
new UI.Toolbar.ToolbarSettingCheckbox(this.groupComputedStylesSetting, undefined, i18nString(UIStrings.group)));
|
|
340
|
-
|
|
341
337
|
this.linkifier = new Components.Linkifier.Linkifier(maxLinkLength);
|
|
342
|
-
|
|
343
338
|
this.imagePreviewPopover = new ImagePreviewPopover(this.contentElement, event => {
|
|
344
339
|
const link = event.composedPath()[0];
|
|
345
340
|
if (link instanceof Element) {
|
|
346
341
|
return link;
|
|
347
342
|
}
|
|
348
343
|
return null;
|
|
349
|
-
}, () => this
|
|
344
|
+
}, () => this.#computedStyleModel ? this.#computedStyleModel.node : null);
|
|
350
345
|
|
|
351
346
|
this.#updateView({hasMatches: true});
|
|
352
347
|
}
|
|
@@ -373,15 +368,46 @@ export class ComputedStyleWidget extends UI.Widget.VBox {
|
|
|
373
368
|
this.#view(
|
|
374
369
|
{
|
|
375
370
|
computedStylesTree: this.#computedStylesTree,
|
|
376
|
-
toolbar: this.toolbarElement,
|
|
377
371
|
hasMatches,
|
|
378
|
-
computedStyleModel: this
|
|
372
|
+
computedStyleModel: this.#computedStyleModel,
|
|
373
|
+
showInheritedComputedStylePropertiesSetting: this.showInheritedComputedStylePropertiesSetting,
|
|
374
|
+
groupComputedStylesSetting: this.groupComputedStylesSetting,
|
|
375
|
+
onFilterChanged: this.onFilterChanged.bind(this),
|
|
376
|
+
filterText: this.#filterText,
|
|
379
377
|
},
|
|
380
378
|
null, this.contentElement);
|
|
381
379
|
}
|
|
382
380
|
|
|
381
|
+
get nodeStyle(): ComputedStyleModule.ComputedStyleModel.ComputedStyle|null {
|
|
382
|
+
return this.#nodeStyle;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
set nodeStyle(nodeStyle: ComputedStyleModule.ComputedStyleModel.ComputedStyle|null) {
|
|
386
|
+
this.#nodeStyle = nodeStyle;
|
|
387
|
+
this.requestUpdate();
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
get matchedStyles(): SDK.CSSMatchedStyles.CSSMatchedStyles|null {
|
|
391
|
+
return this.#matchedStyles;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
set matchedStyles(matchedStyles: SDK.CSSMatchedStyles.CSSMatchedStyles|null) {
|
|
395
|
+
this.#matchedStyles = matchedStyles;
|
|
396
|
+
this.requestUpdate();
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
get computedStyleModel(): ComputedStyleModule.ComputedStyleModel.ComputedStyleModel|undefined {
|
|
400
|
+
return this.#computedStyleModel;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
set computedStyleModel(computedStyleModel: ComputedStyleModule.ComputedStyleModel.ComputedStyleModel) {
|
|
404
|
+
this.#computedStyleModel = computedStyleModel;
|
|
405
|
+
this.requestUpdate();
|
|
406
|
+
}
|
|
407
|
+
|
|
383
408
|
override async performUpdate(): Promise<void> {
|
|
384
|
-
const
|
|
409
|
+
const nodeStyles = this.#nodeStyle;
|
|
410
|
+
const matchedStyles = this.#matchedStyles;
|
|
385
411
|
if (!nodeStyles || !matchedStyles) {
|
|
386
412
|
this.#updateView({hasMatches: false});
|
|
387
413
|
return;
|
|
@@ -399,7 +425,7 @@ export class ComputedStyleWidget extends UI.Widget.VBox {
|
|
|
399
425
|
matchedStyles: SDK.CSSMatchedStyles.CSSMatchedStyles): Promise<void> {
|
|
400
426
|
this.imagePreviewPopover.hide();
|
|
401
427
|
this.linkifier.reset();
|
|
402
|
-
const cssModel = this
|
|
428
|
+
const cssModel = this.#computedStyleModel?.cssModel();
|
|
403
429
|
if (!cssModel) {
|
|
404
430
|
return;
|
|
405
431
|
}
|
|
@@ -442,7 +468,7 @@ export class ComputedStyleWidget extends UI.Widget.VBox {
|
|
|
442
468
|
matchedStyles: SDK.CSSMatchedStyles.CSSMatchedStyles|null): Promise<void> {
|
|
443
469
|
this.imagePreviewPopover.hide();
|
|
444
470
|
this.linkifier.reset();
|
|
445
|
-
const cssModel = this
|
|
471
|
+
const cssModel = this.#computedStyleModel?.cssModel();
|
|
446
472
|
if (!nodeStyle || !matchedStyles || !cssModel) {
|
|
447
473
|
this.#updateView({hasMatches: false});
|
|
448
474
|
return;
|
|
@@ -628,13 +654,14 @@ export class ComputedStyleWidget extends UI.Widget.VBox {
|
|
|
628
654
|
return result;
|
|
629
655
|
}
|
|
630
656
|
|
|
631
|
-
private async onFilterChanged(event:
|
|
657
|
+
private async onFilterChanged(event: CustomEvent<string>): Promise<void> {
|
|
658
|
+
this.#filterText = event.detail;
|
|
632
659
|
await this.filterComputedStyles(
|
|
633
|
-
event.
|
|
660
|
+
event.detail ? new RegExp(Platform.StringUtilities.escapeForRegExp(event.detail), 'i') : null);
|
|
634
661
|
|
|
635
|
-
if (event.
|
|
662
|
+
if (event.detail && this.#computedStylesTree.data && this.#computedStylesTree.data.tree) {
|
|
636
663
|
UI.ARIAUtils.LiveAnnouncer.alert(i18nString(
|
|
637
|
-
UIStrings.filterUpdateAriaText, {PH1: event.
|
|
664
|
+
UIStrings.filterUpdateAriaText, {PH1: event.detail, PH2: this.#computedStylesTree.data.tree.length}));
|
|
638
665
|
}
|
|
639
666
|
}
|
|
640
667
|
|
|
@@ -646,6 +673,11 @@ export class ComputedStyleWidget extends UI.Widget.VBox {
|
|
|
646
673
|
return this.filterAlphabeticalList();
|
|
647
674
|
}
|
|
648
675
|
|
|
676
|
+
setFilterInput(text: string): void {
|
|
677
|
+
this.#filterText = text;
|
|
678
|
+
this.requestUpdate();
|
|
679
|
+
}
|
|
680
|
+
|
|
649
681
|
private nodeFilter(node: TreeOutline.TreeOutlineUtils.TreeNode<ComputedStyleData>): boolean {
|
|
650
682
|
const regex = this.filterRegex;
|
|
651
683
|
const data = node.treeNodeData;
|
|
@@ -106,7 +106,7 @@ export const DEFAULT_VIEW: View = (input, _output, target) => {
|
|
|
106
106
|
jslog=${VisualLogging.pane('element-states')}>
|
|
107
107
|
<div class="page-state-checkbox">
|
|
108
108
|
<devtools-checkbox class="small" title=${i18nString(UIStrings.emulatesAFocusedPage)}
|
|
109
|
-
|
|
109
|
+
${bindToSetting('emulate-page-focus')}>${
|
|
110
110
|
i18nString(UIStrings.emulateFocusedPage)}</devtools-checkbox>
|
|
111
111
|
<devtools-button
|
|
112
112
|
@click=${() => UIHelpers.openInNewTab('https://developer.chrome.com/docs/devtools/rendering/apply-effects#emulate_a_focused_page')}
|
|
@@ -212,7 +212,7 @@ export class ElementsPanel extends UI.Panel.Panel implements UI.SearchableView.S
|
|
|
212
212
|
private readonly accessibilityTreeView: AccessibilityTreeView|undefined;
|
|
213
213
|
private breadcrumbs: ElementsComponents.ElementsBreadcrumbs.ElementsBreadcrumbs;
|
|
214
214
|
stylesWidget: StylesSidebarPane;
|
|
215
|
-
|
|
215
|
+
readonly #computedStyleWidget: ComputedStyleWidget;
|
|
216
216
|
private readonly metricsWidget: MetricsSidebarPane;
|
|
217
217
|
private searchResults!: Array<{
|
|
218
218
|
domModel: SDK.DOMModel.DOMModel,
|
|
@@ -315,7 +315,13 @@ export class ElementsPanel extends UI.Panel.Panel implements UI.SearchableView.S
|
|
|
315
315
|
ComputedStyleWidget, this.evaluateTrackingComputedStyleUpdatesForNode, this);
|
|
316
316
|
|
|
317
317
|
this.stylesWidget = new StylesSidebarPane(this.#computedStyleModel);
|
|
318
|
-
this
|
|
318
|
+
this.#computedStyleWidget = new ComputedStyleWidget();
|
|
319
|
+
this.#computedStyleWidget.computedStyleModel = this.#computedStyleModel;
|
|
320
|
+
this.#computedStyleModel.addEventListener(
|
|
321
|
+
ComputedStyle.ComputedStyleModel.Events.COMPUTED_STYLE_CHANGED, this.#updateComputedStyles, this);
|
|
322
|
+
this.#computedStyleModel.addEventListener(
|
|
323
|
+
ComputedStyle.ComputedStyleModel.Events.CSS_MODEL_CHANGED, this.#updateComputedStyles, this);
|
|
324
|
+
|
|
319
325
|
this.metricsWidget = new MetricsSidebarPane(this.#computedStyleModel);
|
|
320
326
|
|
|
321
327
|
Common.Settings.Settings.instance()
|
|
@@ -374,6 +380,13 @@ export class ElementsPanel extends UI.Panel.Panel implements UI.SearchableView.S
|
|
|
374
380
|
shouldTrackComputedStyleUpdates ? selectedNode.id : undefined);
|
|
375
381
|
}, 100);
|
|
376
382
|
|
|
383
|
+
async #updateComputedStyles(): Promise<void> {
|
|
384
|
+
const computedStyle = await this.#computedStyleModel.fetchComputedStyle();
|
|
385
|
+
const matchedCascade = await this.#computedStyleModel.fetchMatchedCascade();
|
|
386
|
+
this.#computedStyleWidget.nodeStyle = computedStyle;
|
|
387
|
+
this.#computedStyleWidget.matchedStyles = matchedCascade;
|
|
388
|
+
}
|
|
389
|
+
|
|
377
390
|
private handleElementExpanded(): void {
|
|
378
391
|
if (Annotations.AnnotationRepository.annotationsEnabled()) {
|
|
379
392
|
void PanelCommon.AnnotationManager.instance().resolveAnnotationsOfType(Annotations.AnnotationType.ELEMENT_NODE);
|
|
@@ -1007,7 +1020,7 @@ export class ElementsPanel extends UI.Panel.Panel implements UI.SearchableView.S
|
|
|
1007
1020
|
const computedStylePanesWrapper = new UI.Widget.VBox();
|
|
1008
1021
|
computedStylePanesWrapper.element.classList.add('style-panes-wrapper');
|
|
1009
1022
|
computedStylePanesWrapper.element.setAttribute('jslog', `${VisualLogging.pane('computed').track({resize: true})}`);
|
|
1010
|
-
this
|
|
1023
|
+
this.#computedStyleWidget.show(computedStylePanesWrapper.element);
|
|
1011
1024
|
|
|
1012
1025
|
const stylesSplitWidget = new UI.SplitWidget.SplitWidget(
|
|
1013
1026
|
true /* isVertical */, true /* secondIsSidebar */, 'elements.styles.sidebar.width', 100);
|
|
@@ -1024,7 +1037,7 @@ export class ElementsPanel extends UI.Panel.Panel implements UI.SearchableView.S
|
|
|
1024
1037
|
});
|
|
1025
1038
|
|
|
1026
1039
|
const showMetricsWidgetInComputedPane = (): void => {
|
|
1027
|
-
this.metricsWidget.show(computedStylePanesWrapper.element, this
|
|
1040
|
+
this.metricsWidget.show(computedStylePanesWrapper.element, this.#computedStyleWidget.element);
|
|
1028
1041
|
this.stylesWidget.removeEventListener(StylesSidebarPaneEvents.STYLES_UPDATE_COMPLETED, toggleMetricsWidget);
|
|
1029
1042
|
};
|
|
1030
1043
|
|
|
@@ -1147,7 +1160,7 @@ export class ElementsPanel extends UI.Panel.Panel implements UI.SearchableView.S
|
|
|
1147
1160
|
}
|
|
1148
1161
|
|
|
1149
1162
|
getComputedStyleWidget(): ComputedStyleWidget {
|
|
1150
|
-
return this
|
|
1163
|
+
return this.#computedStyleWidget;
|
|
1151
1164
|
}
|
|
1152
1165
|
|
|
1153
1166
|
private setupStyleTracking(cssModel: SDK.CSSModel.CSSModel): void {
|