chrome-devtools-frontend 1.0.1548870 → 1.0.1549484
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/docs/contributing/settings-experiments-features.md +35 -0
- package/docs/styleguide/ux/patterns.md +27 -0
- package/eslint.config.mjs +1 -0
- package/front_end/Tests.js +2 -0
- package/front_end/core/host/InspectorFrontendHost.ts +26 -558
- package/front_end/core/host/InspectorFrontendHostAPI.ts +6 -3
- package/front_end/core/host/InspectorFrontendHostStub.ts +558 -0
- package/front_end/core/host/ResourceLoader.ts +9 -23
- package/front_end/core/host/UserMetrics.ts +4 -4
- package/front_end/core/root/DevToolsContext.ts +4 -0
- package/front_end/core/root/Runtime.ts +10 -0
- package/front_end/core/sdk/CSSMatchedStyles.ts +2 -2
- package/front_end/core/sdk/CSSModel.ts +24 -24
- package/front_end/core/sdk/CSSPropertyParserMatchers.ts +11 -11
- package/front_end/core/sdk/CSSQuery.ts +1 -1
- package/front_end/core/sdk/CSSRule.ts +2 -2
- package/front_end/core/sdk/CSSStyleDeclaration.ts +1 -1
- package/front_end/core/sdk/CSSStyleSheetHeader.ts +1 -1
- package/front_end/core/sdk/DOMModel.ts +3 -0
- package/front_end/core/sdk/NetworkManager.ts +29 -31
- package/front_end/core/sdk/NetworkRequest.ts +4 -0
- package/front_end/core/sdk/OverlayModel.ts +2 -2
- package/front_end/core/sdk/PageResourceLoader.ts +63 -37
- package/front_end/core/sdk/SourceMap.ts +6 -0
- package/front_end/core/sdk/SourceMapCache.ts +21 -0
- package/front_end/core/sdk/SourceMapManager.ts +7 -6
- package/front_end/core/sdk/SourceMapScopesInfo.ts +6 -2
- package/front_end/core/sdk/TargetManager.ts +14 -2
- package/front_end/core/sdk/sdk-meta.ts +13 -0
- package/front_end/entrypoints/formatter_worker/FormatterActions.ts +1 -0
- package/front_end/entrypoints/formatter_worker/ScopeParser.ts +1 -1
- package/front_end/entrypoints/main/MainImpl.ts +13 -3
- package/front_end/foundation/Universe.ts +1 -1
- package/front_end/generated/Deprecation.ts +18 -4
- package/front_end/generated/InspectorBackendCommands.ts +33 -31
- package/front_end/generated/SupportedCSSProperties.js +41 -41
- package/front_end/generated/protocol-mapping.d.ts +12 -0
- package/front_end/generated/protocol-proxy-api.d.ts +11 -0
- package/front_end/generated/protocol.ts +70 -35
- package/front_end/models/ai_assistance/AiConversation.ts +5 -4
- package/front_end/models/ai_assistance/ChangeManager.ts +4 -4
- package/front_end/models/ai_assistance/ConversationHandler.ts +0 -15
- package/front_end/models/ai_assistance/agents/AiAgent.ts +9 -6
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +135 -3
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +24 -0
- package/front_end/models/bindings/CompilerScriptMapping.ts +43 -0
- package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +19 -0
- package/front_end/models/bindings/ResourceMapping.ts +73 -0
- package/front_end/models/bindings/ResourceScriptMapping.ts +50 -0
- package/front_end/models/issues_manager/GenericIssue.ts +17 -0
- package/front_end/models/issues_manager/descriptions/genericNavigationEntryMarkedSkippable.md +7 -0
- package/front_end/models/javascript_metadata/NativeFunctions.js +7 -3
- package/front_end/models/source_map_scopes/FunctionCodeResolver.snapshot.txt +98 -0
- package/front_end/models/source_map_scopes/FunctionCodeResolver.ts +270 -0
- package/front_end/models/source_map_scopes/source_map_scopes.ts +2 -0
- package/front_end/models/workspace/UISourceCode.ts +51 -44
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +76 -34
- package/front_end/panels/ai_assistance/aiAssistancePanel.css +1 -0
- package/front_end/panels/ai_assistance/components/ChatView.ts +23 -11
- package/front_end/panels/application/AppManifestView.ts +3 -2
- package/front_end/panels/application/FrameDetailsView.ts +5 -6
- package/front_end/panels/application/ServiceWorkersView.ts +2 -2
- package/front_end/panels/application/TrustTokensTreeElement.ts +2 -6
- package/front_end/panels/application/components/PermissionsPolicySection.ts +201 -157
- package/front_end/panels/application/components/ProtocolHandlersView.ts +117 -80
- package/front_end/panels/application/components/ServiceWorkerRouterView.ts +47 -41
- package/front_end/panels/application/components/StorageMetadataView.ts +31 -34
- package/front_end/panels/application/components/TrustTokensView.ts +76 -68
- package/front_end/panels/console/ConsoleView.ts +3 -2
- package/front_end/panels/console/ConsoleViewMessage.ts +6 -4
- package/front_end/panels/console/console-meta.ts +0 -13
- package/front_end/panels/developer_resources/DeveloperResourcesView.ts +3 -1
- package/front_end/panels/elements/CSSRuleValidator.ts +7 -7
- package/front_end/panels/elements/CSSRuleValidatorHelper.ts +2 -2
- package/front_end/panels/elements/ElementsTreeElement.ts +16 -13
- package/front_end/panels/elements/ElementsTreeOutline.ts +2 -1
- package/front_end/panels/elements/LayoutPane.ts +12 -10
- package/front_end/panels/elements/StylePropertyTreeElement.ts +12 -12
- package/front_end/panels/elements/components/AdornerManager.ts +3 -3
- package/front_end/panels/elements/components/StylePropertyEditor.ts +6 -6
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryHighlightChipList.ts +27 -49
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryInspector.ts +15 -11
- package/front_end/panels/media/PlayerListView.ts +100 -73
- package/front_end/panels/media/playerListView.css +5 -0
- package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +3 -3
- package/front_end/panels/network/RequestConditionsDrawer.ts +5 -5
- package/front_end/panels/network/components/DirectSocketConnectionView.ts +17 -0
- package/front_end/panels/network/resourceChunkView.css +4 -0
- package/front_end/panels/security/CookieControlsView.ts +1 -1
- package/front_end/panels/sensors/LocationsSettingsTab.ts +1 -1
- package/front_end/panels/settings/FrameworkIgnoreListSettingsTab.ts +1 -1
- package/front_end/panels/settings/KeybindsSettingsTab.ts +1 -1
- package/front_end/panels/settings/SettingsScreen.ts +6 -6
- package/front_end/panels/settings/WorkspaceSettingsTab.ts +1 -1
- package/front_end/panels/settings/emulation/DevicesSettingsTab.ts +1 -1
- package/front_end/panels/snippets/SnippetsQuickOpen.ts +4 -2
- package/front_end/panels/sources/CSSPlugin.ts +1 -1
- package/front_end/panels/sources/FilteredUISourceCodeListProvider.ts +13 -5
- package/front_end/panels/sources/GoToLineQuickOpen.ts +4 -2
- package/front_end/panels/sources/NavigatorView.ts +2 -2
- package/front_end/panels/sources/OpenFileQuickOpen.ts +7 -8
- package/front_end/panels/sources/OutlineQuickOpen.ts +6 -3
- package/front_end/panels/sources/ProfilePlugin.ts +21 -12
- package/front_end/panels/sources/UISourceCodeFrame.ts +0 -1
- package/front_end/panels/sources/filteredUISourceCodeListProvider.css +41 -0
- package/front_end/panels/timeline/TimelinePanel.ts +17 -18
- package/front_end/panels/timeline/TimelineSelectorStatsView.ts +3 -3
- package/front_end/panels/timeline/components/insights/SlowCSSSelector.ts +2 -2
- package/front_end/panels/timeline/docs/flame_chart_migration.md +11 -16
- package/front_end/panels/utils/utils.ts +17 -3
- package/front_end/panels/whats_new/ReleaseNoteText.ts +10 -20
- package/front_end/panels/whats_new/resources/WNDT.md +8 -8
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/puppeteer/third_party/mitt/README.chromium +1 -0
- package/front_end/third_party/puppeteer/third_party/parsel/README.chromium +1 -0
- package/front_end/third_party/puppeteer/third_party/rxjs/README.chromium +1 -0
- package/front_end/ui/components/adorners/Adorner.ts +1 -1
- package/front_end/ui/components/annotations/AnnotationRepository.ts +98 -0
- package/front_end/ui/components/annotations/AnnotationType.ts +10 -0
- package/front_end/ui/components/annotations/annotations.ts +6 -0
- package/front_end/ui/components/buttons/Button.ts +1 -1
- package/front_end/ui/components/buttons/FloatingButton.ts +1 -1
- package/front_end/ui/components/chrome_link/ChromeLink.ts +1 -1
- package/front_end/ui/components/dialogs/ButtonDialog.ts +1 -1
- package/front_end/ui/components/dialogs/Dialog.ts +1 -1
- package/front_end/ui/components/dialogs/ShortcutDialog.ts +1 -0
- package/front_end/ui/components/diff_view/DiffView.ts +1 -1
- package/front_end/ui/components/expandable_list/ExpandableList.ts +1 -1
- package/front_end/ui/components/highlighting/HighlightElement.ts +1 -0
- package/front_end/ui/components/highlighting/MarkupHighlight.ts +162 -0
- package/front_end/ui/components/highlighting/highlighting.ts +7 -0
- package/front_end/ui/components/icon_button/FileSourceIcon.ts +1 -1
- package/front_end/ui/components/icon_button/Icon.ts +4 -2
- package/front_end/ui/components/icon_button/IconButton.ts +1 -1
- package/front_end/ui/components/issue_counter/IssueCounter.ts +1 -1
- package/front_end/ui/components/issue_counter/IssueLinkIcon.ts +1 -1
- package/front_end/ui/components/legacy_wrapper/LegacyWrapper.ts +1 -1
- package/front_end/ui/components/linkifier/LinkifierImpl.ts +1 -1
- package/front_end/ui/components/list/List.ts +184 -0
- package/front_end/ui/components/list/list.css +90 -0
- package/front_end/ui/components/{cards/cards.ts → list/lists.ts} +3 -3
- package/front_end/ui/components/markdown_view/CodeBlock.ts +1 -1
- package/front_end/ui/components/markdown_view/MarkdownImage.ts +1 -1
- package/front_end/ui/components/markdown_view/MarkdownLink.ts +1 -1
- package/front_end/ui/components/markdown_view/MarkdownView.ts +1 -1
- package/front_end/ui/components/menus/Menu.ts +1 -1
- package/front_end/ui/components/menus/SelectMenu.ts +1 -1
- package/front_end/ui/components/node_text/NodeText.ts +1 -1
- package/front_end/ui/components/panel_feedback/FeedbackButton.ts +1 -1
- package/front_end/ui/components/panel_feedback/PanelFeedback.ts +1 -1
- package/front_end/ui/components/panel_feedback/PreviewToggle.ts +1 -1
- package/front_end/ui/components/panel_introduction_steps/PanelIntroductionSteps.ts +1 -1
- package/front_end/ui/components/report_view/ReportView.ts +1 -1
- package/front_end/ui/components/request_link_icon/RequestLinkIcon.ts +1 -1
- package/front_end/ui/components/settings/SettingCheckbox.ts +1 -1
- package/front_end/ui/components/settings/SettingDeprecationWarning.ts +1 -1
- package/front_end/ui/components/snackbars/Snackbar.ts +1 -1
- package/front_end/ui/components/spinners/Spinner.ts +1 -1
- package/front_end/ui/components/srgb_overlay/SrgbOverlay.ts +1 -1
- package/front_end/ui/components/suggestion_input/SuggestionInput.ts +1 -0
- package/front_end/ui/components/survey_link/SurveyLink.ts +1 -1
- package/front_end/ui/components/switch/SwitchImpl.ts +1 -1
- package/front_end/ui/components/text_editor/TextEditor.ts +1 -0
- package/front_end/ui/components/text_prompt/TextPrompt.ts +1 -1
- package/front_end/ui/components/tooltips/Tooltip.ts +1 -1
- package/front_end/ui/components/tree_outline/TreeOutline.ts +1 -1
- package/front_end/ui/kit/kit.ts +5 -0
- package/front_end/ui/legacy/TabbedPane.ts +98 -0
- package/front_end/ui/legacy/UIUtils.ts +0 -184
- package/front_end/ui/legacy/ViewManager.ts +23 -8
- package/front_end/ui/legacy/ViewRegistration.ts +21 -22
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +5 -4
- package/front_end/ui/legacy/components/perf_ui/LineLevelProfile.ts +73 -35
- package/front_end/ui/legacy/components/perf_ui/LiveHeapProfile.ts +11 -2
- package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +12 -13
- package/front_end/ui/legacy/components/quick_open/FilteredListWidget.ts +7 -16
- package/front_end/ui/legacy/components/quick_open/HelpQuickOpen.ts +5 -6
- package/front_end/ui/legacy/components/quick_open/filteredListWidget.css +18 -65
- package/front_end/ui/legacy/components/source_frame/JSONView.ts +2 -1
- package/front_end/ui/legacy/tabbedPane.css +10 -0
- package/front_end/ui/visual_logging/KnownContextValues.ts +3 -0
- package/inspector_overlay/README.md +3 -3
- package/mcp/HostBindings.ts +310 -0
- package/mcp/mcp.ts +17 -0
- package/mcp/tsconfig.json +6 -1
- package/package.json +26 -24
- /package/front_end/ui/{components → kit}/cards/Card.ts +0 -0
- /package/front_end/ui/{components → kit}/cards/card.css +0 -0
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// Copyright 2020 The Chromium Authors
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
|
-
/* eslint-disable @devtools/no-lit-render-outside-of-view */
|
|
5
4
|
|
|
6
5
|
import '../../../ui/components/icon_button/icon_button.js';
|
|
7
6
|
import '../../../ui/legacy/components/data_grid/data_grid.js';
|
|
@@ -10,8 +9,6 @@ import * as i18n from '../../../core/i18n/i18n.js';
|
|
|
10
9
|
import * as SDK from '../../../core/sdk/sdk.js';
|
|
11
10
|
import type * as Protocol from '../../../generated/protocol.js';
|
|
12
11
|
import * as Buttons from '../../../ui/components/buttons/buttons.js';
|
|
13
|
-
import * as LegacyWrapper from '../../../ui/components/legacy_wrapper/legacy_wrapper.js';
|
|
14
|
-
import * as RenderCoordinator from '../../../ui/components/render_coordinator/render_coordinator.js';
|
|
15
12
|
import * as UI from '../../../ui/legacy/legacy.js';
|
|
16
13
|
import * as Lit from '../../../ui/lit/lit.js';
|
|
17
14
|
import * as VisualLogging from '../../../ui/visual_logging/visual_logging.js';
|
|
@@ -64,7 +61,7 @@ const UIStrings = {
|
|
|
64
61
|
const str_ = i18n.i18n.registerUIStrings('panels/application/components/TrustTokensView.ts', UIStrings);
|
|
65
62
|
export const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
66
63
|
|
|
67
|
-
export interface
|
|
64
|
+
export interface TrustTokensViewInput {
|
|
68
65
|
tokens: Protocol.Storage.TrustTokens[];
|
|
69
66
|
deleteClickHandler: (issuerOrigin: string) => void;
|
|
70
67
|
}
|
|
@@ -72,65 +69,32 @@ export interface TrustTokensViewData {
|
|
|
72
69
|
/** Fetch the Trust Token data regularly from the backend while the panel is open */
|
|
73
70
|
const REFRESH_INTERVAL_MS = 1000;
|
|
74
71
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
#deleteClickHandler(issuerOrigin: string): void {
|
|
79
|
-
const mainTarget = SDK.TargetManager.TargetManager.instance().primaryPageTarget();
|
|
80
|
-
void mainTarget?.storageAgent().invoke_clearTrustTokens({issuerOrigin});
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
connectedCallback(): void {
|
|
84
|
-
this.wrapper?.contentElement.classList.add('vbox');
|
|
85
|
-
void this.render();
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
override async render(): Promise<void> {
|
|
89
|
-
const mainTarget = SDK.TargetManager.TargetManager.instance().primaryPageTarget();
|
|
90
|
-
if (!mainTarget) {
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
const {tokens} = await mainTarget.storageAgent().invoke_getTrustTokens();
|
|
94
|
-
tokens.sort((a, b) => a.issuerOrigin.localeCompare(b.issuerOrigin));
|
|
95
|
-
|
|
96
|
-
await RenderCoordinator.write('Render TrustTokensView', () => {
|
|
97
|
-
// clang-format off
|
|
98
|
-
Lit.render(html`
|
|
99
|
-
<style>${trustTokensViewStyles}</style>
|
|
100
|
-
<style>${UI.inspectorCommonStyles}</style>
|
|
101
|
-
${this.#renderGridOrNoDataMessage(tokens)}
|
|
102
|
-
`, this.#shadow, {host: this});
|
|
103
|
-
// clang-format on
|
|
104
|
-
if (this.isConnected) {
|
|
105
|
-
setTimeout(() => this.render(), REFRESH_INTERVAL_MS);
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
#renderGridOrNoDataMessage(tokens: Protocol.Storage.TrustTokens[]): Lit.TemplateResult {
|
|
111
|
-
if (tokens.length === 0) {
|
|
112
|
-
// clang-format off
|
|
72
|
+
function renderGridOrNoDataMessage(input: TrustTokensViewInput): Lit.TemplateResult {
|
|
73
|
+
if (input.tokens.length === 0) {
|
|
74
|
+
// clang-format off
|
|
113
75
|
return html`
|
|
114
|
-
<div
|
|
115
|
-
<div class="empty-state
|
|
116
|
-
|
|
117
|
-
<
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
76
|
+
<div jslog=${VisualLogging.pane('trust-tokens')}>
|
|
77
|
+
<div class="empty-state" jslog=${VisualLogging.section().context('empty-view')}>
|
|
78
|
+
<div class="empty-state-header">${i18nString(UIStrings.noTrustTokens)}</div>
|
|
79
|
+
<div class="empty-state-description">
|
|
80
|
+
<span>${i18nString(UIStrings.trustTokensDescription)}</span>
|
|
81
|
+
<x-link
|
|
82
|
+
class="x-link devtools-link"
|
|
83
|
+
href=${PRIVATE_STATE_TOKENS_EXPLANATION_URL}
|
|
84
|
+
jslog=${VisualLogging.link()
|
|
85
|
+
.track({ click: true, keydown: 'Enter|Space' })
|
|
86
|
+
.context('learn-more')}
|
|
87
|
+
>${i18nString(UIStrings.learnMore)}</x-link>
|
|
88
|
+
</div>
|
|
125
89
|
</div>
|
|
126
90
|
</div>
|
|
127
91
|
`;
|
|
128
|
-
|
|
129
|
-
|
|
92
|
+
// clang-format on
|
|
93
|
+
}
|
|
130
94
|
|
|
131
|
-
|
|
95
|
+
// clang-format off
|
|
132
96
|
return html`
|
|
133
|
-
<div>
|
|
97
|
+
<div jslog=${VisualLogging.pane('trust-tokens')}>
|
|
134
98
|
<span class="heading">${i18nString(UIStrings.trustTokens)}</span>
|
|
135
99
|
<devtools-icon name="info" title=${i18nString(UIStrings.allStoredTrustTokensAvailableIn)}></devtools-icon>
|
|
136
100
|
<devtools-data-grid striped inline>
|
|
@@ -140,7 +104,7 @@ export class TrustTokensView extends LegacyWrapper.LegacyWrapper.WrappableCompon
|
|
|
140
104
|
<th id="count" weight="5" sortable>${i18nString(UIStrings.storedTokenCount)}</th>
|
|
141
105
|
<th id="delete-button" weight="1" sortable></th>
|
|
142
106
|
</tr>
|
|
143
|
-
${tokens.filter(token => token.count > 0)
|
|
107
|
+
${input.tokens.filter(token => token.count > 0)
|
|
144
108
|
.map(token => html`
|
|
145
109
|
<tr>
|
|
146
110
|
<td>${removeTrailingSlash(token.issuerOrigin)}</td>
|
|
@@ -151,7 +115,7 @@ export class TrustTokensView extends LegacyWrapper.LegacyWrapper.WrappableCompon
|
|
|
151
115
|
.size=${Buttons.Button.Size.SMALL}
|
|
152
116
|
.title=${i18nString(UIStrings.deleteTrustTokens, {PH1: removeTrailingSlash(token.issuerOrigin)})}
|
|
153
117
|
.variant=${Buttons.Button.Variant.ICON}
|
|
154
|
-
@click=${
|
|
118
|
+
@click=${() =>input.deleteClickHandler(removeTrailingSlash(token.issuerOrigin))}></devtools-button>
|
|
155
119
|
</td>
|
|
156
120
|
</tr>
|
|
157
121
|
`)}
|
|
@@ -159,18 +123,62 @@ export class TrustTokensView extends LegacyWrapper.LegacyWrapper.WrappableCompon
|
|
|
159
123
|
</devtools-data-grid>
|
|
160
124
|
</div>
|
|
161
125
|
`;
|
|
162
|
-
|
|
163
|
-
}
|
|
126
|
+
// clang-format on
|
|
164
127
|
}
|
|
165
128
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
129
|
+
type View = (input: TrustTokensViewInput, output: undefined, target: HTMLElement) => void;
|
|
130
|
+
|
|
131
|
+
const DEFAULT_VIEW: View = (input, output, target) => {
|
|
132
|
+
// clang-format off
|
|
133
|
+
Lit.render(html`
|
|
134
|
+
<style>${trustTokensViewStyles}</style>
|
|
135
|
+
<style>${UI.inspectorCommonStyles}</style>
|
|
136
|
+
${renderGridOrNoDataMessage(input)}
|
|
137
|
+
`, target);
|
|
138
|
+
// clang-format on
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
export class TrustTokensView extends UI.Widget.VBox {
|
|
142
|
+
#updateInterval = 0;
|
|
143
|
+
#tokens: Protocol.Storage.TrustTokens[] = [];
|
|
144
|
+
#view: View;
|
|
145
|
+
|
|
146
|
+
constructor(element?: HTMLElement, view = DEFAULT_VIEW) {
|
|
147
|
+
super(element, {useShadowDom: true});
|
|
148
|
+
this.#view = view;
|
|
149
|
+
}
|
|
169
150
|
|
|
170
|
-
|
|
151
|
+
override wasShown(): void {
|
|
152
|
+
super.wasShown();
|
|
153
|
+
this.requestUpdate();
|
|
154
|
+
this.#updateInterval = setInterval(this.requestUpdate.bind(this), REFRESH_INTERVAL_MS);
|
|
155
|
+
}
|
|
171
156
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
157
|
+
override willHide(): void {
|
|
158
|
+
super.willHide();
|
|
159
|
+
clearInterval(this.#updateInterval);
|
|
160
|
+
this.#updateInterval = 0;
|
|
175
161
|
}
|
|
162
|
+
|
|
163
|
+
override async performUpdate(): Promise<void> {
|
|
164
|
+
const mainTarget = SDK.TargetManager.TargetManager.instance().primaryPageTarget();
|
|
165
|
+
if (!mainTarget) {
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
const {tokens} = await mainTarget.storageAgent().invoke_getTrustTokens();
|
|
169
|
+
tokens.sort((a, b) => a.issuerOrigin.localeCompare(b.issuerOrigin));
|
|
170
|
+
this.#tokens = tokens;
|
|
171
|
+
this.#view(
|
|
172
|
+
{tokens: this.#tokens, deleteClickHandler: this.#deleteClickHandler.bind(this)}, undefined,
|
|
173
|
+
this.contentElement);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
#deleteClickHandler(issuerOrigin: string): void {
|
|
177
|
+
const mainTarget = SDK.TargetManager.TargetManager.instance().primaryPageTarget();
|
|
178
|
+
void mainTarget?.storageAgent().invoke_clearTrustTokens({issuerOrigin});
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
function removeTrailingSlash(s: string): string {
|
|
183
|
+
return s.replace(/\/$/, '');
|
|
176
184
|
}
|
|
@@ -47,6 +47,7 @@ import * as IssuesManager from '../../models/issues_manager/issues_manager.js';
|
|
|
47
47
|
import * as Logs from '../../models/logs/logs.js';
|
|
48
48
|
import * as TextUtils from '../../models/text_utils/text_utils.js';
|
|
49
49
|
import * as CodeHighlighter from '../../ui/components/code_highlighter/code_highlighter.js';
|
|
50
|
+
import * as Highlighting from '../../ui/components/highlighting/highlighting.js';
|
|
50
51
|
import * as IconButton from '../../ui/components/icon_button/icon_button.js';
|
|
51
52
|
import * as IssueCounter from '../../ui/components/issue_counter/issue_counter.js';
|
|
52
53
|
// eslint-disable-next-line @devtools/es-modules-import
|
|
@@ -1618,7 +1619,7 @@ export class ConsoleView extends UI.Widget.VBox implements
|
|
|
1618
1619
|
matchRange = this.regexMatchRanges[this.currentMatchRangeIndex];
|
|
1619
1620
|
const message = this.visibleViewMessages[matchRange.messageIndex];
|
|
1620
1621
|
message.searchHighlightNode(matchRange.matchIndex)
|
|
1621
|
-
.classList.remove(
|
|
1622
|
+
.classList.remove(Highlighting.highlightedCurrentSearchResultClassName);
|
|
1622
1623
|
}
|
|
1623
1624
|
|
|
1624
1625
|
index = Platform.NumberUtilities.mod(index, this.regexMatchRanges.length);
|
|
@@ -1627,7 +1628,7 @@ export class ConsoleView extends UI.Widget.VBox implements
|
|
|
1627
1628
|
matchRange = this.regexMatchRanges[index];
|
|
1628
1629
|
const message = this.visibleViewMessages[matchRange.messageIndex];
|
|
1629
1630
|
const highlightNode = message.searchHighlightNode(matchRange.matchIndex);
|
|
1630
|
-
highlightNode.classList.add(
|
|
1631
|
+
highlightNode.classList.add(Highlighting.highlightedCurrentSearchResultClassName);
|
|
1631
1632
|
if (scrollIntoView) {
|
|
1632
1633
|
this.viewport.scrollItemIntoView(matchRange.messageIndex);
|
|
1633
1634
|
highlightNode.scrollIntoViewIfNeeded();
|
|
@@ -49,6 +49,7 @@ import * as TextUtils from '../../models/text_utils/text_utils.js';
|
|
|
49
49
|
import * as Workspace from '../../models/workspace/workspace.js';
|
|
50
50
|
import * as Buttons from '../../ui/components/buttons/buttons.js';
|
|
51
51
|
import * as CodeHighlighter from '../../ui/components/code_highlighter/code_highlighter.js';
|
|
52
|
+
import * as Highlighting from '../../ui/components/highlighting/highlighting.js';
|
|
52
53
|
import * as IconButton from '../../ui/components/icon_button/icon_button.js';
|
|
53
54
|
import * as IssueCounter from '../../ui/components/issue_counter/issue_counter.js';
|
|
54
55
|
import * as RequestLinkIcon from '../../ui/components/request_link_icon/request_link_icon.js';
|
|
@@ -323,7 +324,7 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
|
|
|
323
324
|
protected contentElementInternal: HTMLElement|null;
|
|
324
325
|
private nestingLevelMarkers: HTMLElement[]|null;
|
|
325
326
|
private searchHighlightNodes: Element[];
|
|
326
|
-
private searchHighlightNodeChanges:
|
|
327
|
+
private searchHighlightNodeChanges: Highlighting.HighlightChange[];
|
|
327
328
|
private isVisibleInternal: boolean;
|
|
328
329
|
private cachedHeight: number;
|
|
329
330
|
private messagePrefix: string;
|
|
@@ -1739,7 +1740,7 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
|
|
|
1739
1740
|
|
|
1740
1741
|
setSearchRegex(regex: RegExp|null): void {
|
|
1741
1742
|
if (this.searchHighlightNodeChanges?.length) {
|
|
1742
|
-
|
|
1743
|
+
Highlighting.revertDomChanges(this.searchHighlightNodeChanges);
|
|
1743
1744
|
}
|
|
1744
1745
|
this.searchRegexInternal = regex;
|
|
1745
1746
|
this.searchHighlightNodes = [];
|
|
@@ -1757,8 +1758,9 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
|
|
|
1757
1758
|
}
|
|
1758
1759
|
|
|
1759
1760
|
if (sourceRanges.length) {
|
|
1760
|
-
this.searchHighlightNodes =
|
|
1761
|
-
|
|
1761
|
+
this.searchHighlightNodes = Highlighting.highlightRangesWithStyleClass(
|
|
1762
|
+
this.contentElement(), sourceRanges, Highlighting.highlightedSearchResultClassName,
|
|
1763
|
+
this.searchHighlightNodeChanges);
|
|
1762
1764
|
}
|
|
1763
1765
|
}
|
|
1764
1766
|
|
|
@@ -53,10 +53,6 @@ const UIStrings = {
|
|
|
53
53
|
* @description Title of a setting under the Console category that can be invoked through the Command Menu
|
|
54
54
|
*/
|
|
55
55
|
showMessagesFromAllContexts: 'Show messages from all contexts',
|
|
56
|
-
/**
|
|
57
|
-
* @description Title of a setting under the Console category in Settings
|
|
58
|
-
*/
|
|
59
|
-
logXmlhttprequests: 'Log XMLHttpRequests',
|
|
60
56
|
/**
|
|
61
57
|
* @description Title of a setting under the Console category
|
|
62
58
|
*/
|
|
@@ -283,15 +279,6 @@ Common.Settings.registerSettingExtension({
|
|
|
283
279
|
],
|
|
284
280
|
});
|
|
285
281
|
|
|
286
|
-
Common.Settings.registerSettingExtension({
|
|
287
|
-
category: Common.Settings.SettingCategory.CONSOLE,
|
|
288
|
-
storageType: Common.Settings.SettingStorageType.SYNCED,
|
|
289
|
-
title: i18nLazyString(UIStrings.logXmlhttprequests),
|
|
290
|
-
settingName: 'monitoring-xhr-enabled',
|
|
291
|
-
settingType: Common.Settings.SettingType.BOOLEAN,
|
|
292
|
-
defaultValue: false,
|
|
293
|
-
});
|
|
294
|
-
|
|
295
282
|
Common.Settings.registerSettingExtension({
|
|
296
283
|
category: Common.Settings.SettingCategory.CONSOLE,
|
|
297
284
|
storageType: Common.Settings.SettingStorageType.SYNCED,
|
|
@@ -72,6 +72,7 @@ interface ViewInput {
|
|
|
72
72
|
filters: TextUtils.TextUtils.ParsedFilter[];
|
|
73
73
|
numResources: number;
|
|
74
74
|
numLoading: number;
|
|
75
|
+
loadThroughTargetSetting: Common.Settings.Setting<boolean>;
|
|
75
76
|
}
|
|
76
77
|
|
|
77
78
|
type View = (input: ViewInput, output: object, target: HTMLElement) => void;
|
|
@@ -91,7 +92,7 @@ export const DEFAULT_VIEW: View = (input, _output, target) => {
|
|
|
91
92
|
</devtools-toolbar-input>
|
|
92
93
|
<devtools-checkbox
|
|
93
94
|
title=${i18nString(UIStrings.loadHttpsDeveloperResources)}
|
|
94
|
-
${bindToSetting(
|
|
95
|
+
${bindToSetting(input.loadThroughTargetSetting)}>
|
|
95
96
|
${i18nString(UIStrings.enableLoadingThroughTarget)}
|
|
96
97
|
</devtools-checkbox>
|
|
97
98
|
</devtools-toolbar>
|
|
@@ -146,6 +147,7 @@ export class DeveloperResourcesView extends UI.Widget.VBox {
|
|
|
146
147
|
filters: this.#filters,
|
|
147
148
|
numResources: resources,
|
|
148
149
|
numLoading: loading,
|
|
150
|
+
loadThroughTargetSetting: this.#loader.getLoadThroughTargetSetting(),
|
|
149
151
|
};
|
|
150
152
|
const output = {};
|
|
151
153
|
this.#view(input, output, this.contentElement);
|
|
@@ -12,8 +12,8 @@ import {
|
|
|
12
12
|
isBlockContainer,
|
|
13
13
|
isFlexContainer,
|
|
14
14
|
isGridContainer,
|
|
15
|
+
isGridLanesContainer,
|
|
15
16
|
isInlineElement,
|
|
16
|
-
isMasonryContainer,
|
|
17
17
|
isMulticolContainer,
|
|
18
18
|
isPossiblyReplacedElement,
|
|
19
19
|
} from './CSSRuleValidatorHelper.js';
|
|
@@ -145,7 +145,7 @@ export class AlignContentValidator extends CSSRuleValidator {
|
|
|
145
145
|
}
|
|
146
146
|
const isFlex = isFlexContainer(computedStyles);
|
|
147
147
|
if (!isFlex && !isBlockContainer(computedStyles) && !isGridContainer(computedStyles) &&
|
|
148
|
-
!
|
|
148
|
+
!isGridLanesContainer(computedStyles)) {
|
|
149
149
|
const reasonPropertyDeclaration = buildPropertyDefinitionText('display', computedStyles?.get('display'));
|
|
150
150
|
const affectedPropertyDeclarationCode = buildPropertyName('align-content');
|
|
151
151
|
|
|
@@ -257,7 +257,7 @@ export class GridContainerValidator extends CSSRuleValidator {
|
|
|
257
257
|
}
|
|
258
258
|
|
|
259
259
|
getHint(propertyName: string, computedStyles?: Map<string, string>): Hint|undefined {
|
|
260
|
-
if (isGridContainer(computedStyles) ||
|
|
260
|
+
if (isGridContainer(computedStyles) || isGridLanesContainer(computedStyles)) {
|
|
261
261
|
return;
|
|
262
262
|
}
|
|
263
263
|
const reasonPropertyDeclaration = buildPropertyDefinitionText('display', computedStyles?.get('display'));
|
|
@@ -293,7 +293,7 @@ export class GridItemValidator extends CSSRuleValidator {
|
|
|
293
293
|
if (!parentComputedStyles) {
|
|
294
294
|
return;
|
|
295
295
|
}
|
|
296
|
-
if (isGridContainer(parentComputedStyles) ||
|
|
296
|
+
if (isGridContainer(parentComputedStyles) || isGridLanesContainer(parentComputedStyles)) {
|
|
297
297
|
return;
|
|
298
298
|
}
|
|
299
299
|
const reasonPropertyDeclaration = buildPropertyDefinitionText('display', parentComputedStyles?.get('display'));
|
|
@@ -358,13 +358,13 @@ export class FlexGridValidator extends CSSRuleValidator {
|
|
|
358
358
|
return;
|
|
359
359
|
}
|
|
360
360
|
|
|
361
|
-
if (isFlexContainer(computedStyles) || isGridContainer(computedStyles) ||
|
|
361
|
+
if (isFlexContainer(computedStyles) || isGridContainer(computedStyles) || isGridLanesContainer(computedStyles)) {
|
|
362
362
|
return;
|
|
363
363
|
}
|
|
364
364
|
|
|
365
365
|
if (parentComputedStyles &&
|
|
366
366
|
(isFlexContainer(parentComputedStyles) || isGridContainer(parentComputedStyles) ||
|
|
367
|
-
|
|
367
|
+
isGridLanesContainer(parentComputedStyles))) {
|
|
368
368
|
const reasonContainerDisplayName = buildPropertyValue(parentComputedStyles.get('display') as string);
|
|
369
369
|
const reasonPropertyName = buildPropertyName(propertyName);
|
|
370
370
|
const reasonAlternativePropertyName = buildPropertyName('justify-self');
|
|
@@ -414,7 +414,7 @@ export class MulticolFlexGridValidator extends CSSRuleValidator {
|
|
|
414
414
|
}
|
|
415
415
|
|
|
416
416
|
if (isMulticolContainer(computedStyles) || isFlexContainer(computedStyles) || isGridContainer(computedStyles) ||
|
|
417
|
-
|
|
417
|
+
isGridLanesContainer(computedStyles)) {
|
|
418
418
|
return;
|
|
419
419
|
}
|
|
420
420
|
|
|
@@ -91,12 +91,12 @@ export const isGridContainer = (computedStyles?: Map<string, string>): boolean =
|
|
|
91
91
|
return display === 'grid' || display === 'inline-grid';
|
|
92
92
|
};
|
|
93
93
|
|
|
94
|
-
export const
|
|
94
|
+
export const isGridLanesContainer = (computedStyles?: Map<string, string>): boolean => {
|
|
95
95
|
if (!computedStyles) {
|
|
96
96
|
return false;
|
|
97
97
|
}
|
|
98
98
|
const display = computedStyles.get('display');
|
|
99
|
-
return display === '
|
|
99
|
+
return display === 'grid-lanes' || display === 'inline-grid-lanes';
|
|
100
100
|
};
|
|
101
101
|
|
|
102
102
|
export const isMulticolContainer = (computedStyles?: Map<string, string>): boolean => {
|
|
@@ -195,11 +195,14 @@ const UIStrings = {
|
|
|
195
195
|
/**
|
|
196
196
|
* @description ARIA label for Elements Tree adorners
|
|
197
197
|
*/
|
|
198
|
-
enableMasonryMode: 'Enable masonry mode',
|
|
199
198
|
/**
|
|
200
199
|
* @description ARIA label for Elements Tree adorners
|
|
201
200
|
*/
|
|
202
|
-
|
|
201
|
+
enableGridLanesMode: 'Enable grid-lanes mode',
|
|
202
|
+
/**
|
|
203
|
+
* @description ARIA label for Elements Tree adorners
|
|
204
|
+
*/
|
|
205
|
+
disableGridLanesMode: 'Disable grid-lanes mode',
|
|
203
206
|
/**
|
|
204
207
|
* @description ARIA label for an elements tree adorner
|
|
205
208
|
*/
|
|
@@ -2003,7 +2006,7 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
2003
2006
|
++highlightIndex;
|
|
2004
2007
|
}
|
|
2005
2008
|
element.setTextContentTruncatedIfNeeded(value);
|
|
2006
|
-
|
|
2009
|
+
Highlighting.highlightRangesWithStyleClass(element, result.entityRanges, 'webkit-html-entity-value');
|
|
2007
2010
|
}
|
|
2008
2011
|
|
|
2009
2012
|
const hasText = (forceValue || value.length > 0);
|
|
@@ -2271,7 +2274,7 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
2271
2274
|
}
|
|
2272
2275
|
const result = convertUnicodeCharsToHTMLEntities(firstChild.nodeValue());
|
|
2273
2276
|
textNodeElement.textContent = Platform.StringUtilities.collapseWhitespace(result.text);
|
|
2274
|
-
|
|
2277
|
+
Highlighting.highlightRangesWithStyleClass(textNodeElement, result.entityRanges, 'webkit-html-entity-value');
|
|
2275
2278
|
UI.UIUtils.createTextChild(titleDOM, '\u200B');
|
|
2276
2279
|
this.buildTagDOM(titleDOM, tagName, true, false, updateRecord);
|
|
2277
2280
|
if (updateRecord?.hasChangedChildren()) {
|
|
@@ -2311,7 +2314,7 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
2311
2314
|
'jslog', `${VisualLogging.value('text-node').track({change: true, dblclick: true})}`);
|
|
2312
2315
|
const result = convertUnicodeCharsToHTMLEntities(node.nodeValue());
|
|
2313
2316
|
textNodeElement.textContent = Platform.StringUtilities.collapseWhitespace(result.text);
|
|
2314
|
-
|
|
2317
|
+
Highlighting.highlightRangesWithStyleClass(textNodeElement, result.entityRanges, 'webkit-html-entity-value');
|
|
2315
2318
|
UI.UIUtils.createTextChild(titleDOM, '"');
|
|
2316
2319
|
if (updateRecord?.isCharDataModified()) {
|
|
2317
2320
|
UI.UIUtils.runCSSAnimationOnce(textNodeElement, 'dom-update-highlight');
|
|
@@ -2625,7 +2628,7 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
2625
2628
|
// TODO: move this to the template.
|
|
2626
2629
|
this.removeAdornersByType(ElementsComponents.AdornerManager.RegisteredAdorners.SUBGRID);
|
|
2627
2630
|
this.removeAdornersByType(ElementsComponents.AdornerManager.RegisteredAdorners.GRID);
|
|
2628
|
-
this.removeAdornersByType(ElementsComponents.AdornerManager.RegisteredAdorners.
|
|
2631
|
+
this.removeAdornersByType(ElementsComponents.AdornerManager.RegisteredAdorners.GRID_LANES);
|
|
2629
2632
|
this.removeAdornersByType(ElementsComponents.AdornerManager.RegisteredAdorners.FLEX);
|
|
2630
2633
|
this.removeAdornersByType(ElementsComponents.AdornerManager.RegisteredAdorners.SCROLL_SNAP);
|
|
2631
2634
|
this.removeAdornersByType(ElementsComponents.AdornerManager.RegisteredAdorners.CONTAINER);
|
|
@@ -2636,8 +2639,8 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
2636
2639
|
if (layout.isGrid) {
|
|
2637
2640
|
this.pushGridAdorner(layout.isSubgrid);
|
|
2638
2641
|
}
|
|
2639
|
-
if (layout.
|
|
2640
|
-
this.
|
|
2642
|
+
if (layout.isGridLanes) {
|
|
2643
|
+
this.pushGridLanesAdorner();
|
|
2641
2644
|
}
|
|
2642
2645
|
if (layout.isFlex) {
|
|
2643
2646
|
this.pushFlexAdorner();
|
|
@@ -2746,7 +2749,7 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
2746
2749
|
}
|
|
2747
2750
|
}
|
|
2748
2751
|
|
|
2749
|
-
|
|
2752
|
+
pushGridLanesAdorner(): void {
|
|
2750
2753
|
const node = this.node();
|
|
2751
2754
|
const nodeId = node.id;
|
|
2752
2755
|
if (!nodeId) {
|
|
@@ -2754,9 +2757,9 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
2754
2757
|
}
|
|
2755
2758
|
|
|
2756
2759
|
const config = ElementsComponents.AdornerManager.getRegisteredAdorner(
|
|
2757
|
-
ElementsComponents.AdornerManager.RegisteredAdorners.
|
|
2760
|
+
ElementsComponents.AdornerManager.RegisteredAdorners.GRID_LANES);
|
|
2758
2761
|
const adorner = this.adorn(config);
|
|
2759
|
-
adorner.classList.add('
|
|
2762
|
+
adorner.classList.add('grid-lanes');
|
|
2760
2763
|
|
|
2761
2764
|
const onClick = ((() => {
|
|
2762
2765
|
if (adorner.isActive()) {
|
|
@@ -2769,8 +2772,8 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
2769
2772
|
adorner.addInteraction(onClick, {
|
|
2770
2773
|
isToggle: true,
|
|
2771
2774
|
shouldPropagateOnKeydown: false,
|
|
2772
|
-
ariaLabelDefault: i18nString(UIStrings.
|
|
2773
|
-
ariaLabelActive: i18nString(UIStrings.
|
|
2775
|
+
ariaLabelDefault: i18nString(UIStrings.enableGridLanesMode),
|
|
2776
|
+
ariaLabelActive: i18nString(UIStrings.disableGridLanesMode),
|
|
2774
2777
|
});
|
|
2775
2778
|
|
|
2776
2779
|
node.domModel().overlayModel().addEventListener(
|
|
@@ -41,6 +41,7 @@ import * as Badges from '../../models/badges/badges.js';
|
|
|
41
41
|
import * as Elements from '../../models/elements/elements.js';
|
|
42
42
|
import * as IssuesManager from '../../models/issues_manager/issues_manager.js';
|
|
43
43
|
import * as CodeHighlighter from '../../ui/components/code_highlighter/code_highlighter.js';
|
|
44
|
+
import * as Highlighting from '../../ui/components/highlighting/highlighting.js';
|
|
44
45
|
import * as IssueCounter from '../../ui/components/issue_counter/issue_counter.js';
|
|
45
46
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
46
47
|
import {html, nothing, render} from '../../ui/lit/lit.js';
|
|
@@ -369,7 +370,7 @@ export class DOMTreeWidget extends UI.Widget.Widget {
|
|
|
369
370
|
treeElement.highlightSearchResults(query);
|
|
370
371
|
}
|
|
371
372
|
treeElement.reveal();
|
|
372
|
-
const matches = treeElement.listItemElement.getElementsByClassName(
|
|
373
|
+
const matches = treeElement.listItemElement.getElementsByClassName(Highlighting.highlightedSearchResultClassName);
|
|
373
374
|
if (matches.length) {
|
|
374
375
|
matches[0].scrollIntoViewIfNeeded(false);
|
|
375
376
|
}
|
|
@@ -25,9 +25,9 @@ const UIStrings = {
|
|
|
25
25
|
*/
|
|
26
26
|
showElementInTheElementsPanel: 'Show element in the Elements panel',
|
|
27
27
|
/**
|
|
28
|
-
* @description Title of a section on CSS Grid/
|
|
28
|
+
* @description Title of a section on CSS Grid/Grid Lanes tooling
|
|
29
29
|
*/
|
|
30
|
-
|
|
30
|
+
gridOrGridLanes: 'Grid / Grid Lanes',
|
|
31
31
|
/**
|
|
32
32
|
* @description Title of a section in the Layout Sidebar pane of the Elements panel
|
|
33
33
|
*/
|
|
@@ -35,11 +35,11 @@ const UIStrings = {
|
|
|
35
35
|
/**
|
|
36
36
|
* @description Title of a section in Layout sidebar pane
|
|
37
37
|
*/
|
|
38
|
-
|
|
38
|
+
gridOrGridLanesOverlays: 'Grid / Grid Lanes overlays',
|
|
39
39
|
/**
|
|
40
|
-
* @description Message in the Layout panel informing users that no CSS Grid/
|
|
40
|
+
* @description Message in the Layout panel informing users that no CSS Grid/Grid Lanes layouts were found on the page
|
|
41
41
|
*/
|
|
42
|
-
|
|
42
|
+
noGridOrGridLanesLayoutsFoundOnThisPage: 'No grid or grid lanes layouts found on this page',
|
|
43
43
|
/**
|
|
44
44
|
* @description Title of the Flexbox section in the Layout panel
|
|
45
45
|
*/
|
|
@@ -289,7 +289,7 @@ const DEFAULT_VIEW: View = (input, output, target) => {
|
|
|
289
289
|
<summary class="header"
|
|
290
290
|
@keydown=${input.onSummaryKeyDown}
|
|
291
291
|
jslog=${VisualLogging.sectionHeader('grid-settings').track({click: true})}>
|
|
292
|
-
${i18nString(UIStrings.
|
|
292
|
+
${i18nString(UIStrings.gridOrGridLanes)}
|
|
293
293
|
</summary>
|
|
294
294
|
<div class="content-section" jslog=${VisualLogging.section('grid-settings')}>
|
|
295
295
|
<h3 class="content-section-title">${i18nString(UIStrings.overlayDisplaySettings)}</h3>
|
|
@@ -327,8 +327,8 @@ const DEFAULT_VIEW: View = (input, output, target) => {
|
|
|
327
327
|
html`<div class="content-section" jslog=${VisualLogging.section('grid-overlays')}>
|
|
328
328
|
<h3 class="content-section-title">
|
|
329
329
|
${input.gridElements.length ?
|
|
330
|
-
i18nString(UIStrings.
|
|
331
|
-
i18nString(UIStrings.
|
|
330
|
+
i18nString(UIStrings.gridOrGridLanesOverlays) :
|
|
331
|
+
i18nString(UIStrings.noGridOrGridLanesLayoutsFoundOnThisPage)}
|
|
332
332
|
</h3>
|
|
333
333
|
${input.gridElements.length ?
|
|
334
334
|
html`<div class="elements">${input.gridElements.map(renderElement)}</div>` :
|
|
@@ -431,8 +431,10 @@ export class LayoutPane extends UI.Widget.Widget {
|
|
|
431
431
|
|
|
432
432
|
async #fetchGridNodes(): Promise<SDK.DOMModel.DOMNode[]> {
|
|
433
433
|
return await this.#fetchNodesByStyle([
|
|
434
|
-
{name: 'display', value: 'grid'},
|
|
435
|
-
{name: 'display', value: 'inline-
|
|
434
|
+
{name: 'display', value: 'grid'},
|
|
435
|
+
{name: 'display', value: 'inline-grid'},
|
|
436
|
+
{name: 'display', value: 'grid-lanes'},
|
|
437
|
+
{name: 'display', value: 'inline-grid-lanes'},
|
|
436
438
|
]);
|
|
437
439
|
}
|
|
438
440
|
|
|
@@ -56,7 +56,7 @@ const {html, nothing, render, Directives: {classMap}} = Lit;
|
|
|
56
56
|
const ASTUtils = SDK.CSSPropertyParser.ASTUtils;
|
|
57
57
|
const FlexboxEditor = ElementsComponents.StylePropertyEditor.FlexboxEditor;
|
|
58
58
|
const GridEditor = ElementsComponents.StylePropertyEditor.GridEditor;
|
|
59
|
-
const
|
|
59
|
+
const GridLanesEditor = ElementsComponents.StylePropertyEditor.GridLanesEditor;
|
|
60
60
|
|
|
61
61
|
const UIStrings = {
|
|
62
62
|
/**
|
|
@@ -109,9 +109,9 @@ const UIStrings = {
|
|
|
109
109
|
*/
|
|
110
110
|
gridEditorButton: 'Open `grid` editor',
|
|
111
111
|
/**
|
|
112
|
-
* @description Title of the button that opens the CSS
|
|
112
|
+
* @description Title of the button that opens the CSS Grid Lanes editor in the Styles panel.
|
|
113
113
|
*/
|
|
114
|
-
|
|
114
|
+
gridLanesEditorButton: 'Open `grid-lanes` editor',
|
|
115
115
|
/**
|
|
116
116
|
* @description A context menu item in Styles panel to copy CSS declaration as JavaScript property.
|
|
117
117
|
*/
|
|
@@ -201,7 +201,7 @@ export class EnvFunctionRenderer extends rendererBase(SDK.CSSPropertyParserMatch
|
|
|
201
201
|
}
|
|
202
202
|
}
|
|
203
203
|
// clang-format off
|
|
204
|
-
export class FlexGridRenderer extends rendererBase(SDK.CSSPropertyParserMatchers.
|
|
204
|
+
export class FlexGridRenderer extends rendererBase(SDK.CSSPropertyParserMatchers.FlexGridGridLanesMatch) {
|
|
205
205
|
// clang-format on
|
|
206
206
|
readonly #treeElement: StylePropertyTreeElement|null;
|
|
207
207
|
readonly #stylesPane: StylesSidebarPane;
|
|
@@ -211,7 +211,7 @@ export class FlexGridRenderer extends rendererBase(SDK.CSSPropertyParserMatchers
|
|
|
211
211
|
this.#stylesPane = stylesPane;
|
|
212
212
|
}
|
|
213
213
|
|
|
214
|
-
override render(match: SDK.CSSPropertyParserMatchers.
|
|
214
|
+
override render(match: SDK.CSSPropertyParserMatchers.FlexGridGridLanesMatch, context: RenderingContext): Node[] {
|
|
215
215
|
const children = Renderer.render(ASTUtils.siblings(ASTUtils.declValue(match.node)), context).nodes;
|
|
216
216
|
if (!this.#treeElement?.editable()) {
|
|
217
217
|
return children;
|
|
@@ -220,14 +220,14 @@ export class FlexGridRenderer extends rendererBase(SDK.CSSPropertyParserMatchers
|
|
|
220
220
|
`${this.#treeElement.section().getSectionIdx()}_${this.#treeElement.section().nextEditorTriggerButtonIdx}`;
|
|
221
221
|
|
|
222
222
|
function getEditorClass(layoutType: SDK.CSSPropertyParserMatchers.LayoutType): typeof FlexboxEditor|
|
|
223
|
-
typeof GridEditor|typeof
|
|
223
|
+
typeof GridEditor|typeof GridLanesEditor {
|
|
224
224
|
switch (layoutType) {
|
|
225
225
|
case SDK.CSSPropertyParserMatchers.LayoutType.FLEX:
|
|
226
226
|
return FlexboxEditor;
|
|
227
227
|
case SDK.CSSPropertyParserMatchers.LayoutType.GRID:
|
|
228
228
|
return GridEditor;
|
|
229
|
-
case SDK.CSSPropertyParserMatchers.LayoutType.
|
|
230
|
-
return
|
|
229
|
+
case SDK.CSSPropertyParserMatchers.LayoutType.GRID_LANES:
|
|
230
|
+
return GridLanesEditor;
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
233
|
|
|
@@ -237,8 +237,8 @@ export class FlexGridRenderer extends rendererBase(SDK.CSSPropertyParserMatchers
|
|
|
237
237
|
return i18nString(UIStrings.flexboxEditorButton);
|
|
238
238
|
case SDK.CSSPropertyParserMatchers.LayoutType.GRID:
|
|
239
239
|
return i18nString(UIStrings.gridEditorButton);
|
|
240
|
-
case SDK.CSSPropertyParserMatchers.LayoutType.
|
|
241
|
-
return i18nString(UIStrings.
|
|
240
|
+
case SDK.CSSPropertyParserMatchers.LayoutType.GRID_LANES:
|
|
241
|
+
return i18nString(UIStrings.gridLanesEditorButton);
|
|
242
242
|
}
|
|
243
243
|
}
|
|
244
244
|
|
|
@@ -248,8 +248,8 @@ export class FlexGridRenderer extends rendererBase(SDK.CSSPropertyParserMatchers
|
|
|
248
248
|
return Host.UserMetrics.SwatchType.FLEX;
|
|
249
249
|
case SDK.CSSPropertyParserMatchers.LayoutType.GRID:
|
|
250
250
|
return Host.UserMetrics.SwatchType.GRID;
|
|
251
|
-
case SDK.CSSPropertyParserMatchers.LayoutType.
|
|
252
|
-
return Host.UserMetrics.SwatchType.
|
|
251
|
+
case SDK.CSSPropertyParserMatchers.LayoutType.GRID_LANES:
|
|
252
|
+
return Host.UserMetrics.SwatchType.GRID_LANES;
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
255
|
|