chrome-devtools-frontend 1.0.1589336 → 1.0.1590494
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/common/Settings.ts +30 -1
- package/front_end/generated/Deprecation.ts +7 -0
- package/front_end/generated/InspectorBackendCommands.ts +9 -3
- package/front_end/generated/protocol-mapping.d.ts +9 -0
- package/front_end/generated/protocol-proxy-api.d.ts +7 -0
- package/front_end/generated/protocol.ts +98 -0
- package/front_end/models/javascript_metadata/NativeFunctions.js +48 -0
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +140 -32
- package/front_end/panels/ai_assistance/README.md +71 -0
- package/front_end/panels/ai_assistance/aiAssistancePanel.css +5 -0
- package/front_end/panels/ai_assistance/ai_assistance.ts +1 -0
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +110 -7
- package/front_end/panels/ai_assistance/components/ChatView.ts +10 -0
- package/front_end/panels/ai_assistance/components/WalkthroughView.ts +208 -0
- package/front_end/panels/ai_assistance/components/chatMessage.css +2 -2
- package/front_end/panels/ai_assistance/components/walkthroughView.css +121 -0
- package/front_end/panels/application/DeviceBoundSessionsView.ts +64 -2
- package/front_end/panels/console/ConsoleView.ts +8 -8
- package/front_end/panels/console/console-meta.ts +10 -6
- package/front_end/panels/elements/ColorSwatchPopoverIcon.ts +14 -14
- package/front_end/panels/elements/ComputedStyleWidget.ts +27 -22
- package/front_end/panels/elements/ElementsTreeElement.ts +56 -2
- package/front_end/panels/elements/ElementsTreeOutline.ts +2 -0
- package/front_end/panels/elements/StyleEditorWidget.ts +12 -12
- package/front_end/panels/elements/StylePropertiesSection.ts +65 -64
- package/front_end/panels/elements/StylePropertyTreeElement.ts +138 -135
- package/front_end/panels/elements/StylesContainer.ts +57 -0
- package/front_end/panels/elements/StylesSidebarPane.ts +2 -1
- package/front_end/panels/layer_viewer/Layers3DView.ts +2 -2
- package/front_end/panels/network/RequestInitiatorView.ts +3 -2
- package/front_end/panels/timeline/timeline-meta.ts +4 -4
- package/front_end/panels/whats_new/ReleaseNoteText.ts +10 -16
- package/front_end/panels/whats_new/resources/WNDT.md +6 -6
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/ui/components/markdown_view/MarkdownView.ts +5 -6
- package/front_end/ui/components/markdown_view/markdownView.css +6 -0
- package/front_end/ui/components/markdown_view/markdown_view.ts +0 -2
- package/front_end/ui/legacy/Treeoutline.ts +58 -10
- package/front_end/ui/legacy/Widget.ts +11 -1
- package/front_end/ui/legacy/inspectorCommon.css +2 -0
- package/front_end/ui/visual_logging/KnownContextValues.ts +11 -1
- package/package.json +1 -1
- package/front_end/ui/components/markdown_view/MarkdownLink.ts +0 -53
- package/front_end/ui/components/markdown_view/markdownLink.css +0 -11
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// Copyright 2026 The Chromium Authors
|
|
2
|
+
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
+
// found in the LICENSE file.
|
|
4
|
+
|
|
5
|
+
import type * as SDK from '../../core/sdk/sdk.js';
|
|
6
|
+
import type * as ComputedStyle from '../../models/computed_style/computed_style.js';
|
|
7
|
+
import type * as TextUtils from '../../models/text_utils/text_utils.js';
|
|
8
|
+
import type * as InlineEditor from '../../ui/legacy/components/inline_editor/inline_editor.js';
|
|
9
|
+
import type * as Components from '../../ui/legacy/components/utils/utils.js';
|
|
10
|
+
|
|
11
|
+
import type * as ElementsComponents from './components/components.js';
|
|
12
|
+
import type {StylePropertiesSection} from './StylePropertiesSection.js';
|
|
13
|
+
import type {StylePropertyTreeElement} from './StylePropertyTreeElement.js';
|
|
14
|
+
import type {WebCustomData} from './WebCustomData.js';
|
|
15
|
+
|
|
16
|
+
export interface StylesContainer {
|
|
17
|
+
activeCSSAngle: InlineEditor.CSSAngle.CSSAngle|null;
|
|
18
|
+
readonly webCustomData: WebCustomData|undefined;
|
|
19
|
+
isEditingStyle: boolean;
|
|
20
|
+
readonly sectionByElement: WeakMap<Node, StylePropertiesSection>;
|
|
21
|
+
readonly element: HTMLElement;
|
|
22
|
+
readonly linkifier: Components.Linkifier.Linkifier;
|
|
23
|
+
|
|
24
|
+
swatchPopoverHelper(): InlineEditor.SwatchPopoverHelper.SwatchPopoverHelper;
|
|
25
|
+
node(): SDK.DOMModel.DOMNode|null;
|
|
26
|
+
cssModel(): SDK.CSSModel.CSSModel|null;
|
|
27
|
+
computedStyleModel(): ComputedStyle.ComputedStyleModel.ComputedStyleModel;
|
|
28
|
+
refreshUpdate(editedSection: StylePropertiesSection, editedTreeElement?: StylePropertyTreeElement): void;
|
|
29
|
+
filterRegex(): RegExp|null;
|
|
30
|
+
setEditingStyle(editing: boolean): void;
|
|
31
|
+
setUserOperation(userOperation: boolean): void;
|
|
32
|
+
forceUpdate(): void;
|
|
33
|
+
hideAllPopovers(): void;
|
|
34
|
+
|
|
35
|
+
getVariablePopoverContents(
|
|
36
|
+
matchedStyles: SDK.CSSMatchedStyles.CSSMatchedStyles, variableName: string,
|
|
37
|
+
computedValue: string|null): ElementsComponents.CSSVariableValueView.CSSVariableValueView;
|
|
38
|
+
getVariableParserError(matchedStyles: SDK.CSSMatchedStyles.CSSMatchedStyles, variableName: string):
|
|
39
|
+
ElementsComponents.CSSVariableValueView.CSSVariableParserError|null;
|
|
40
|
+
jumpToFunctionDefinition(functionName: string): void;
|
|
41
|
+
continueEditingElement(sectionIndex: number, propertyIndex: number): void;
|
|
42
|
+
revealProperty(cssProperty: SDK.CSSProperty.CSSProperty): void;
|
|
43
|
+
resetFocus(): void;
|
|
44
|
+
removeSection(section: StylePropertiesSection): void;
|
|
45
|
+
focusedSectionIndex(): number;
|
|
46
|
+
allSections(): StylePropertiesSection[];
|
|
47
|
+
|
|
48
|
+
addBlankSection(
|
|
49
|
+
insertAfterSection: StylePropertiesSection, styleSheetHeader: SDK.CSSStyleSheetHeader.CSSStyleSheetHeader,
|
|
50
|
+
ruleLocation: TextUtils.TextRange.TextRange): void;
|
|
51
|
+
|
|
52
|
+
jumpToProperty(propertyName: string, sectionName?: string, blockName?: string): boolean;
|
|
53
|
+
jumpToSectionBlock(section: string): void;
|
|
54
|
+
jumpToFontPaletteDefinition(paletteName: string): void;
|
|
55
|
+
jumpToDeclaration(valueSource: SDK.CSSMatchedStyles.CSSValueSource): void;
|
|
56
|
+
setActiveProperty(treeElement: StylePropertyTreeElement|null): void;
|
|
57
|
+
}
|
|
@@ -70,6 +70,7 @@ import {
|
|
|
70
70
|
} from './StylePropertiesSection.js';
|
|
71
71
|
import {StylePropertyHighlighter} from './StylePropertyHighlighter.js';
|
|
72
72
|
import type {StylePropertyTreeElement} from './StylePropertyTreeElement.js';
|
|
73
|
+
import type {StylesContainer} from './StylesContainer.js';
|
|
73
74
|
import stylesSidebarPaneStyles from './stylesSidebarPane.css.js';
|
|
74
75
|
import {WebCustomData} from './WebCustomData.js';
|
|
75
76
|
|
|
@@ -162,7 +163,7 @@ const HIGHLIGHTABLE_PROPERTIES = [
|
|
|
162
163
|
];
|
|
163
164
|
|
|
164
165
|
export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventTypes, typeof ElementsSidebarPane>(
|
|
165
|
-
ElementsSidebarPane) {
|
|
166
|
+
ElementsSidebarPane) implements StylesContainer {
|
|
166
167
|
private matchedStyles: SDK.CSSMatchedStyles.CSSMatchedStyles|null = null;
|
|
167
168
|
private currentToolbarPane: UI.Widget.Widget|null = null;
|
|
168
169
|
private animatedToolbarPane: UI.Widget.Widget|null = null;
|
|
@@ -199,7 +199,7 @@ export class Layers3DView extends Common.ObjectWrapper.eventMixin<EventTypes, ty
|
|
|
199
199
|
i18nString(UIStrings.slowScrollRects), 'frame-viewer-show-slow-scroll-rects', true, this.panelToolbar);
|
|
200
200
|
this.showPaintsSetting.addChangeListener(this.updatePaints, this);
|
|
201
201
|
Common.Settings.Settings.instance()
|
|
202
|
-
|
|
202
|
+
.moduleSetting('frame-viewer-chrome-window')
|
|
203
203
|
.addChangeListener(this.updateData, this);
|
|
204
204
|
|
|
205
205
|
this.performUpdate();
|
|
@@ -731,7 +731,7 @@ export class Layers3DView extends Common.ObjectWrapper.eventMixin<EventTypes, ty
|
|
|
731
731
|
return;
|
|
732
732
|
}
|
|
733
733
|
|
|
734
|
-
const drawChrome =
|
|
734
|
+
const drawChrome = Common.Settings.Settings.instance().moduleSetting('frame-viewer-chrome-window').get() &&
|
|
735
735
|
this.chromeTextures.length >= 3 && this.chromeTextures.indexOf(undefined) < 0;
|
|
736
736
|
const z = (this.maxDepth + 1) * LayerSpacing;
|
|
737
737
|
const borderWidth = Math.ceil(ViewportBorderWidth * this.scale);
|
|
@@ -84,15 +84,16 @@ export const DEFAULT_VIEW = (input: ViewInput, _output: undefined, target: HTMLE
|
|
|
84
84
|
const request = initiators[index];
|
|
85
85
|
const isCurrentRequest = (index === initiators.length - 1);
|
|
86
86
|
const hasFurtherInitiatedNodes = index + 1 < initiators.length;
|
|
87
|
+
const renderedChildren = isCurrentRequest ? renderInitiatedNodes(initiated, request, visited) : nothing;
|
|
87
88
|
|
|
88
89
|
// clang-format off
|
|
89
90
|
return html`
|
|
90
91
|
<li role="treeitem" ?selected=${isCurrentRequest} aria-expanded="true" open>
|
|
91
92
|
<span style=${isCurrentRequest ? 'font-weight: bold' : ''}>${request.url()}</span>
|
|
92
|
-
${hasFurtherInitiatedNodes ||
|
|
93
|
+
${hasFurtherInitiatedNodes || renderedChildren !== nothing ? html`
|
|
93
94
|
<ul role="group">
|
|
94
95
|
${renderInitiatorNodes(initiators, index + 1, initiated, visited)}
|
|
95
|
-
${
|
|
96
|
+
${renderedChildren}
|
|
96
97
|
</ul>` : nothing}
|
|
97
98
|
</li>`;
|
|
98
99
|
// clang-format on
|
|
@@ -61,7 +61,7 @@ const UIStrings = {
|
|
|
61
61
|
/**
|
|
62
62
|
* @description Title of a setting under the Performance category in Settings
|
|
63
63
|
*/
|
|
64
|
-
|
|
64
|
+
chromeFrameInLayersView: 'Chrome frame in Layers view',
|
|
65
65
|
} as const;
|
|
66
66
|
const str_ = i18n.i18n.registerUIStrings('panels/timeline/timeline-meta.ts', UIStrings);
|
|
67
67
|
const i18nLazyString = i18n.i18n.getLazilyComputedLocalizedString.bind(undefined, str_);
|
|
@@ -308,10 +308,10 @@ UI.ActionRegistration.registerActionExtension({
|
|
|
308
308
|
Common.Settings.registerSettingExtension({
|
|
309
309
|
category: Common.Settings.SettingCategory.PERFORMANCE,
|
|
310
310
|
storageType: Common.Settings.SettingStorageType.SYNCED,
|
|
311
|
-
title: i18nLazyString(UIStrings.
|
|
312
|
-
settingName: 'frame-viewer-
|
|
311
|
+
title: i18nLazyString(UIStrings.chromeFrameInLayersView),
|
|
312
|
+
settingName: 'frame-viewer-chrome-window',
|
|
313
313
|
settingType: Common.Settings.SettingType.BOOLEAN,
|
|
314
|
-
defaultValue:
|
|
314
|
+
defaultValue: true,
|
|
315
315
|
});
|
|
316
316
|
|
|
317
317
|
// IMPORTANT: if you are updating this, you should also update the setting in
|
|
@@ -40,28 +40,22 @@ export function getReleaseNote(): ReleaseNote {
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
let releaseNote: ReleaseNote = {
|
|
43
|
-
version:
|
|
44
|
-
header: 'What\'s new in DevTools
|
|
43
|
+
version: 146,
|
|
44
|
+
header: 'What\'s new in DevTools 146',
|
|
45
45
|
markdownLinks: [
|
|
46
46
|
{
|
|
47
|
-
key: '
|
|
48
|
-
link: 'https://developer.chrome.com/blog/new-in-devtools-
|
|
47
|
+
key: 'mcp-server',
|
|
48
|
+
link: 'https://developer.chrome.com/blog/new-in-devtools-146/#mcp-server',
|
|
49
49
|
},
|
|
50
50
|
{
|
|
51
|
-
key: '
|
|
52
|
-
link: 'https://developer.chrome.com/blog/new-in-devtools-
|
|
51
|
+
key: 'console-history',
|
|
52
|
+
link: 'https://developer.chrome.com/blog/new-in-devtools-146/#console-history',
|
|
53
53
|
},
|
|
54
54
|
{
|
|
55
|
-
key: '
|
|
56
|
-
link: 'https://developer.chrome.com/blog/new-in-devtools-
|
|
57
|
-
},
|
|
58
|
-
],
|
|
59
|
-
videoLinks: [
|
|
60
|
-
{
|
|
61
|
-
description: 'See past highlights from Chrome 142-144',
|
|
62
|
-
link: 'https://www.youtube.com/watch?v=2rOeZ98AOb8' as Platform.DevToolsPath.UrlString,
|
|
63
|
-
type: VideoType.WHATS_NEW,
|
|
55
|
+
key: 'adopted-stylesheets',
|
|
56
|
+
link: 'https://developer.chrome.com/blog/new-in-devtools-146/#adopted-stylesheets',
|
|
64
57
|
},
|
|
65
58
|
],
|
|
66
|
-
|
|
59
|
+
videoLinks: [],
|
|
60
|
+
link: 'https://developer.chrome.com/blog/new-in-devtools-146/',
|
|
67
61
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
### [
|
|
1
|
+
### [MCP server](mcp-server)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
CrUX data in performance trace summaries, a new --slim mode, specialized skills and experimental screen recording support.
|
|
4
4
|
|
|
5
|
-
### [
|
|
5
|
+
### [Preserve Console history edits](console-history)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Modify a previous command, browse for another one, and return to your draft without losing your work.
|
|
8
8
|
|
|
9
|
-
### [
|
|
9
|
+
### [Improved support for adopted stylesheets](adopted-stylesheets)
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Adopted Style Sheets are now grouped under a dedicated #adopted-style-sheets node within the DOM tree in the Elements panel.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Name: Dependencies sourced from the upstream `chromium` repository
|
|
2
2
|
URL: https://chromium.googlesource.com/chromium/src
|
|
3
3
|
Version: N/A
|
|
4
|
-
Revision:
|
|
4
|
+
Revision: 070c55b60dd29061a93f753a77d49c7a1a9688d6
|
|
5
5
|
Update Mechanism: Manual (https://crbug.com/428069060)
|
|
6
6
|
License: BSD-3-Clause
|
|
7
7
|
License File: LICENSE
|
|
@@ -5,13 +5,14 @@
|
|
|
5
5
|
|
|
6
6
|
import './CodeBlock.js';
|
|
7
7
|
import './MarkdownImage.js';
|
|
8
|
-
import '
|
|
8
|
+
import '../../kit/kit.js';
|
|
9
9
|
|
|
10
10
|
import type * as Marked from '../../../third_party/marked/marked.js';
|
|
11
11
|
import * as Lit from '../../lit/lit.js';
|
|
12
12
|
import * as VisualLogging from '../../visual_logging/visual_logging.js';
|
|
13
13
|
|
|
14
14
|
import type * as Codeblock from './CodeBlock.js';
|
|
15
|
+
import {getMarkdownLink} from './MarkdownLinksMap.js';
|
|
15
16
|
import markdownViewStyles from './markdownView.css.js';
|
|
16
17
|
|
|
17
18
|
const html = Lit.html;
|
|
@@ -241,12 +242,10 @@ export class MarkdownLitRenderer {
|
|
|
241
242
|
case 'space':
|
|
242
243
|
return Lit.nothing;
|
|
243
244
|
case 'link':
|
|
244
|
-
return html`<devtools-
|
|
245
|
+
return html`<devtools-link
|
|
245
246
|
class=${this.customClassMapForToken('link')}
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
}
|
|
249
|
-
}></devtools-markdown-link>`;
|
|
247
|
+
href=${getMarkdownLink(token.href)}
|
|
248
|
+
>${token.text}</devtools-link>`;
|
|
250
249
|
case 'image':
|
|
251
250
|
return html`<devtools-markdown-image
|
|
252
251
|
class=${this.customClassMapForToken('image')}
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
import * as CodeBlock from './CodeBlock.js';
|
|
6
6
|
import * as MarkdownImage from './MarkdownImage.js';
|
|
7
7
|
import * as MarkdownImagesMap from './MarkdownImagesMap.js';
|
|
8
|
-
import * as MarkdownLink from './MarkdownLink.js';
|
|
9
8
|
import * as MarkdownLinksMap from './MarkdownLinksMap.js';
|
|
10
9
|
import * as MarkdownView from './MarkdownView.js';
|
|
11
10
|
|
|
@@ -13,7 +12,6 @@ export {
|
|
|
13
12
|
CodeBlock,
|
|
14
13
|
MarkdownImage,
|
|
15
14
|
MarkdownImagesMap,
|
|
16
|
-
MarkdownLink,
|
|
17
15
|
MarkdownLinksMap,
|
|
18
16
|
MarkdownView,
|
|
19
17
|
};
|
|
@@ -1538,6 +1538,9 @@ class TreeViewTreeElement extends TreeElement {
|
|
|
1538
1538
|
static readonly CLONED_ATTRIBUTES = SDK.DOMModel.ARIA_ATTRIBUTES.union(new Set(['jslog']));
|
|
1539
1539
|
#clonedAttributes = new Set<string>();
|
|
1540
1540
|
#clonedClasses = new Set<string>();
|
|
1541
|
+
#userExpanded = false;
|
|
1542
|
+
#isProcessingAttribute = false;
|
|
1543
|
+
#previousOpenAttributeValue?: string|null;
|
|
1541
1544
|
|
|
1542
1545
|
static #elementToTreeElement = new WeakMap<Node, TreeViewTreeElement>();
|
|
1543
1546
|
readonly configElement: HTMLLIElement;
|
|
@@ -1549,7 +1552,46 @@ class TreeViewTreeElement extends TreeElement {
|
|
|
1549
1552
|
this.refresh();
|
|
1550
1553
|
}
|
|
1551
1554
|
|
|
1555
|
+
override onexpand(): void {
|
|
1556
|
+
if (!this.#isProcessingAttribute) {
|
|
1557
|
+
this.#userExpanded = true;
|
|
1558
|
+
}
|
|
1559
|
+
}
|
|
1560
|
+
|
|
1561
|
+
override oncollapse(): void {
|
|
1562
|
+
if (!this.#isProcessingAttribute) {
|
|
1563
|
+
this.#userExpanded = false;
|
|
1564
|
+
}
|
|
1565
|
+
}
|
|
1566
|
+
|
|
1567
|
+
updateExpansionFromAttribute(): void {
|
|
1568
|
+
this.#isProcessingAttribute = true;
|
|
1569
|
+
try {
|
|
1570
|
+
const openAttr = this.configElement.getAttribute('open');
|
|
1571
|
+
if (openAttr === this.#previousOpenAttributeValue) {
|
|
1572
|
+
return;
|
|
1573
|
+
}
|
|
1574
|
+
this.#previousOpenAttributeValue = openAttr;
|
|
1575
|
+
if (openAttr === null) {
|
|
1576
|
+
if (this.#userExpanded) {
|
|
1577
|
+
this.expand();
|
|
1578
|
+
} else {
|
|
1579
|
+
this.collapse();
|
|
1580
|
+
}
|
|
1581
|
+
} else if (openAttr === 'false') {
|
|
1582
|
+
this.collapse();
|
|
1583
|
+
} else {
|
|
1584
|
+
this.expand();
|
|
1585
|
+
}
|
|
1586
|
+
} finally {
|
|
1587
|
+
this.#isProcessingAttribute = false;
|
|
1588
|
+
}
|
|
1589
|
+
}
|
|
1590
|
+
|
|
1552
1591
|
refresh(): void {
|
|
1592
|
+
const expandable = Boolean(this.configElement.querySelector('ul[role="group"]'));
|
|
1593
|
+
this.setExpandable(expandable);
|
|
1594
|
+
|
|
1553
1595
|
this.titleElement.textContent = '';
|
|
1554
1596
|
this.#clonedAttributes.forEach(attr => this.listItemElement.attributes.removeNamedItem(attr));
|
|
1555
1597
|
this.#clonedClasses.forEach(className => this.listItemElement.classList.remove(className));
|
|
@@ -1576,6 +1618,7 @@ class TreeViewTreeElement extends TreeElement {
|
|
|
1576
1618
|
}
|
|
1577
1619
|
|
|
1578
1620
|
this.hidden = hasBooleanAttribute(this.configElement, 'hidden');
|
|
1621
|
+
this.updateExpansionFromAttribute();
|
|
1579
1622
|
|
|
1580
1623
|
Highlighting.HighlightManager.HighlightManager.instance().apply(this.titleElement);
|
|
1581
1624
|
}
|
|
@@ -1585,7 +1628,9 @@ class TreeViewTreeElement extends TreeElement {
|
|
|
1585
1628
|
}
|
|
1586
1629
|
|
|
1587
1630
|
remove(): void {
|
|
1588
|
-
removeNode(
|
|
1631
|
+
removeNode(
|
|
1632
|
+
this,
|
|
1633
|
+
Boolean(this.parent && (this.parent as TreeViewTreeElement).configElement?.querySelector('ul[role="group"]')));
|
|
1589
1634
|
TreeViewTreeElement.#elementToTreeElement.delete(this.configElement);
|
|
1590
1635
|
}
|
|
1591
1636
|
}
|
|
@@ -1623,11 +1668,13 @@ function getStyleElements(nodes: NodeList|Node[]): HTMLElement[] {
|
|
|
1623
1668
|
});
|
|
1624
1669
|
}
|
|
1625
1670
|
|
|
1626
|
-
function removeNode(node: TreeElement): void {
|
|
1671
|
+
function removeNode(node: TreeElement, preserveParentExpandable = false): void {
|
|
1627
1672
|
const parent = node.parent;
|
|
1628
1673
|
if (parent) {
|
|
1629
1674
|
parent.removeChild(node);
|
|
1630
|
-
|
|
1675
|
+
if (!preserveParentExpandable) {
|
|
1676
|
+
parent.setExpandable(parent.children().length > 0);
|
|
1677
|
+
}
|
|
1631
1678
|
}
|
|
1632
1679
|
}
|
|
1633
1680
|
|
|
@@ -1742,8 +1789,8 @@ export class TreeViewElement extends HTMLElementWithLightDOMTemplate {
|
|
|
1742
1789
|
if (subtreeRoot.role !== 'group' || !subtreeRoot.parentElement) {
|
|
1743
1790
|
return null;
|
|
1744
1791
|
}
|
|
1745
|
-
const expanded = hasBooleanAttribute(subtreeRoot.parentElement, 'open');
|
|
1746
1792
|
const treeElement = TreeViewTreeElement.get(subtreeRoot.parentElement);
|
|
1793
|
+
const expanded = treeElement ? treeElement.expanded : hasBooleanAttribute(subtreeRoot.parentElement, 'open');
|
|
1747
1794
|
return treeElement ? {expanded, treeElement} : null;
|
|
1748
1795
|
}
|
|
1749
1796
|
|
|
@@ -1764,11 +1811,7 @@ export class TreeViewElement extends HTMLElementWithLightDOMTemplate {
|
|
|
1764
1811
|
treeElement.revealAndSelect(true);
|
|
1765
1812
|
}
|
|
1766
1813
|
if (node === treeNode && attributeName === 'open') {
|
|
1767
|
-
|
|
1768
|
-
treeElement.expand();
|
|
1769
|
-
} else {
|
|
1770
|
-
treeElement.collapse();
|
|
1771
|
-
}
|
|
1814
|
+
treeElement.updateExpansionFromAttribute();
|
|
1772
1815
|
}
|
|
1773
1816
|
}
|
|
1774
1817
|
|
|
@@ -1791,6 +1834,7 @@ export class TreeViewElement extends HTMLElementWithLightDOMTemplate {
|
|
|
1791
1834
|
treeElement = new TreeViewTreeElement(this.#treeOutline, node);
|
|
1792
1835
|
const expandable = Boolean(node.querySelector('ul[role="group"]'));
|
|
1793
1836
|
treeElement.setExpandable(expandable);
|
|
1837
|
+
treeElement.updateExpansionFromAttribute();
|
|
1794
1838
|
} else {
|
|
1795
1839
|
treeElement = node.treeElement;
|
|
1796
1840
|
}
|
|
@@ -1817,7 +1861,11 @@ export class TreeViewElement extends HTMLElementWithLightDOMTemplate {
|
|
|
1817
1861
|
if (node instanceof HTMLLIElement) {
|
|
1818
1862
|
TreeViewTreeElement.get(node)?.remove();
|
|
1819
1863
|
} else if (node.treeElement) {
|
|
1820
|
-
removeNode(
|
|
1864
|
+
removeNode(
|
|
1865
|
+
node.treeElement,
|
|
1866
|
+
Boolean(
|
|
1867
|
+
node.treeElement.parent &&
|
|
1868
|
+
(node.treeElement.parent as TreeViewTreeElement).configElement?.querySelector('ul[role="group"]')));
|
|
1821
1869
|
}
|
|
1822
1870
|
}
|
|
1823
1871
|
}
|
|
@@ -877,6 +877,10 @@ export class Widget {
|
|
|
877
877
|
const widget = Widget.get(autofocusElement);
|
|
878
878
|
if (widget && widget !== this) {
|
|
879
879
|
widget.focus();
|
|
880
|
+
} else if (autofocusElement === this.element && autofocusElement instanceof WidgetElement) {
|
|
881
|
+
// If the autofocus element is the widget itself, we need to call the native focus method
|
|
882
|
+
// to avoid infinite recursion if the element is a WidgetElement.
|
|
883
|
+
HTMLElement.prototype.focus.call(autofocusElement);
|
|
880
884
|
} else {
|
|
881
885
|
autofocusElement.focus();
|
|
882
886
|
}
|
|
@@ -891,7 +895,13 @@ export class Widget {
|
|
|
891
895
|
}
|
|
892
896
|
|
|
893
897
|
if (this.element === this.contentElement && this.element.hasAttribute('autofocus')) {
|
|
894
|
-
this.element
|
|
898
|
+
if (this.element instanceof WidgetElement) {
|
|
899
|
+
// If the autofocus element is the widget itself, we need to call the native focus method
|
|
900
|
+
// to avoid infinite recursion if the element is a WidgetElement.
|
|
901
|
+
HTMLElement.prototype.focus.call(this.element);
|
|
902
|
+
} else {
|
|
903
|
+
this.element.focus();
|
|
904
|
+
}
|
|
895
905
|
}
|
|
896
906
|
}
|
|
897
907
|
|
|
@@ -1198,6 +1198,7 @@ devtools-toolbar {
|
|
|
1198
1198
|
word-break: break-all;
|
|
1199
1199
|
}
|
|
1200
1200
|
|
|
1201
|
+
.webkit-html-processing-instruction,
|
|
1201
1202
|
.webkit-html-tag {
|
|
1202
1203
|
color: var(--sys-color-token-tag);
|
|
1203
1204
|
}
|
|
@@ -1238,6 +1239,7 @@ devtools-toolbar {
|
|
|
1238
1239
|
/* See: crbug.com/1152736 for color variable migration. */
|
|
1239
1240
|
}
|
|
1240
1241
|
|
|
1242
|
+
.webkit-html-processing-instruction-value,
|
|
1241
1243
|
.webkit-html-attribute-name {
|
|
1242
1244
|
/* Keep this in sync with view-source.css (.webkit-html-attribute-name) */
|
|
1243
1245
|
color: var(--sys-color-token-attribute);
|
|
@@ -360,6 +360,7 @@ export const knownContextValues = new Set([
|
|
|
360
360
|
'ai-code-generation-upgrade-dialog.manage-in-settings',
|
|
361
361
|
'ai-code-generation-used',
|
|
362
362
|
'ai-explorer',
|
|
363
|
+
'ai-show-walkthrough',
|
|
363
364
|
'ai_assistance',
|
|
364
365
|
'align-content',
|
|
365
366
|
'align-content-center',
|
|
@@ -788,6 +789,7 @@ export const knownContextValues = new Set([
|
|
|
788
789
|
'close-others',
|
|
789
790
|
'close-search',
|
|
790
791
|
'close-tabs-to-the-right',
|
|
792
|
+
'close-walkthrough',
|
|
791
793
|
'closeable-tabs',
|
|
792
794
|
'closeableTabs',
|
|
793
795
|
'code',
|
|
@@ -1416,6 +1418,7 @@ export const knownContextValues = new Set([
|
|
|
1416
1418
|
'elements.dom-properties',
|
|
1417
1419
|
'elements.duplicate-element',
|
|
1418
1420
|
'elements.edit-as-html',
|
|
1421
|
+
'elements.edit-data',
|
|
1419
1422
|
'elements.event-listeners',
|
|
1420
1423
|
'elements.generic-sidebar-popover',
|
|
1421
1424
|
'elements.hide-element',
|
|
@@ -1704,6 +1707,9 @@ export const knownContextValues = new Set([
|
|
|
1704
1707
|
'frame-creation-stack-trace',
|
|
1705
1708
|
'frame-resource',
|
|
1706
1709
|
'frame-sizing',
|
|
1710
|
+
'frame-viewer-chrome-window',
|
|
1711
|
+
'frame-viewer-chrome-window-false',
|
|
1712
|
+
'frame-viewer-chrome-window-true',
|
|
1707
1713
|
'frame-viewer-hide-chrome-window',
|
|
1708
1714
|
'frame-viewer-show-paints',
|
|
1709
1715
|
'frame-viewer-show-slow-scroll-rects',
|
|
@@ -1876,7 +1882,6 @@ export const knownContextValues = new Set([
|
|
|
1876
1882
|
'hide-issues',
|
|
1877
1883
|
'hide-messages-from',
|
|
1878
1884
|
'hide-network-messages',
|
|
1879
|
-
'hide-network-messages-true',
|
|
1880
1885
|
'hide-player',
|
|
1881
1886
|
'hide-repeating-children',
|
|
1882
1887
|
'highlight-node-on-hover-in-overlay',
|
|
@@ -2700,6 +2705,9 @@ export const knownContextValues = new Set([
|
|
|
2700
2705
|
'network-log.preserve-log-true',
|
|
2701
2706
|
'network-log.record-log',
|
|
2702
2707
|
'network-main',
|
|
2708
|
+
'network-messages',
|
|
2709
|
+
'network-messages-false',
|
|
2710
|
+
'network-messages-true',
|
|
2703
2711
|
'network-only-blocked-requests',
|
|
2704
2712
|
'network-only-ip-protected-requests',
|
|
2705
2713
|
'network-only-third-party-setting',
|
|
@@ -3016,6 +3024,7 @@ export const knownContextValues = new Set([
|
|
|
3016
3024
|
'privacy-policy.console-insights',
|
|
3017
3025
|
'privacy-sandbox-update',
|
|
3018
3026
|
'private-state-tokens',
|
|
3027
|
+
'processing-instruction-value',
|
|
3019
3028
|
'production-origin',
|
|
3020
3029
|
'profile-loading-failed',
|
|
3021
3030
|
'profile-options',
|
|
@@ -3584,6 +3593,7 @@ export const knownContextValues = new Set([
|
|
|
3584
3593
|
'show-scroll-bottleneck-rects-true',
|
|
3585
3594
|
'show-shortcuts',
|
|
3586
3595
|
'show-test-addresses-in-autofill-menu-on-event',
|
|
3596
|
+
'show-thinking',
|
|
3587
3597
|
'show-third-party-issues',
|
|
3588
3598
|
'show-ua-shadow-dom',
|
|
3589
3599
|
'show-url-decoded',
|
package/package.json
CHANGED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
// Copyright 2020 The Chromium Authors
|
|
2
|
-
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
-
// found in the LICENSE file.
|
|
4
|
-
/* eslint-disable @devtools/no-lit-render-outside-of-view, @devtools/enforce-custom-element-definitions-location */
|
|
5
|
-
|
|
6
|
-
import '../../kit/kit.js';
|
|
7
|
-
|
|
8
|
-
import {html, render} from '../../lit/lit.js';
|
|
9
|
-
|
|
10
|
-
import markdownLinkStyles from './markdownLink.css.js';
|
|
11
|
-
import {getMarkdownLink} from './MarkdownLinksMap.js';
|
|
12
|
-
|
|
13
|
-
export interface MarkdownLinkData {
|
|
14
|
-
key: string;
|
|
15
|
-
title: string;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Component to render link from parsed markdown.
|
|
20
|
-
* Parsed links from markdown are not directly rendered, instead they have to be added to the <key, link> map in MarkdownLinksMap.ts.
|
|
21
|
-
* This makes sure that all links are accounted for and no bad links are introduced to devtools via markdown.
|
|
22
|
-
*/
|
|
23
|
-
export class MarkdownLink extends HTMLElement {
|
|
24
|
-
readonly #shadow = this.attachShadow({mode: 'open'});
|
|
25
|
-
#linkText = '';
|
|
26
|
-
#linkUrl = '';
|
|
27
|
-
|
|
28
|
-
set data(data: MarkdownLinkData) {
|
|
29
|
-
const {key, title} = data;
|
|
30
|
-
const markdownLink = getMarkdownLink(key);
|
|
31
|
-
this.#linkText = title;
|
|
32
|
-
this.#linkUrl = markdownLink;
|
|
33
|
-
this.#render();
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
#render(): void {
|
|
37
|
-
// clang-format off
|
|
38
|
-
const output = html`
|
|
39
|
-
<style>${markdownLinkStyles}</style>
|
|
40
|
-
<devtools-link class="devtools-link" href=${this.#linkUrl}
|
|
41
|
-
>${this.#linkText}</devtools-link>`;
|
|
42
|
-
render(output, this.#shadow, {host: this});
|
|
43
|
-
// clang-format on
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
customElements.define('devtools-markdown-link', MarkdownLink);
|
|
48
|
-
|
|
49
|
-
declare global {
|
|
50
|
-
interface HTMLElementTagNameMap {
|
|
51
|
-
'devtools-markdown-link': MarkdownLink;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2021 The Chromium Authors
|
|
3
|
-
* Use of this source code is governed by a BSD-style license that can be
|
|
4
|
-
* found in the LICENSE file.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
.devtools-link {
|
|
8
|
-
color: var(--sys-color-primary);
|
|
9
|
-
outline-offset: 2px;
|
|
10
|
-
text-decoration: underline;
|
|
11
|
-
}
|