chrome-devtools-frontend 1.0.1543082 → 1.0.1544076
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/AUTHORS +2 -0
- package/front_end/core/common/Gzip.ts +4 -4
- package/front_end/core/common/common.ts +0 -2
- package/front_end/core/host/AidaClient.ts +10 -7
- package/front_end/core/host/DispatchHttpRequestClient.ts +18 -3
- package/front_end/core/root/DevToolsContext.ts +60 -0
- package/front_end/core/root/Runtime.ts +8 -7
- package/front_end/core/root/root.ts +6 -1
- package/front_end/core/sdk/CPUThrottlingManager.ts +0 -4
- package/front_end/core/sdk/CSSMatchedStyles.ts +7 -9
- package/front_end/core/sdk/CSSModel.ts +1 -1
- package/front_end/core/sdk/CSSRule.ts +18 -6
- package/front_end/core/sdk/ChildTargetManager.ts +2 -2
- package/front_end/core/sdk/TargetManager.ts +5 -6
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshotLoader.ts +2 -0
- package/front_end/entrypoints/inspector_main/InspectorMain.ts +1 -13
- package/front_end/entrypoints/main/MainImpl.ts +2 -20
- package/front_end/foundation/Universe.ts +24 -1
- package/front_end/models/ai_assistance/agents/AiAgent.ts +10 -8
- package/front_end/models/ai_assistance/agents/PatchAgent.ts +7 -1
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +0 -5
- package/front_end/models/ai_assistance/agents/StylingAgent.ts +4 -8
- package/front_end/models/ai_code_completion/AiCodeCompletion.ts +1 -1
- package/front_end/models/ai_code_generation/AiCodeGeneration.ts +5 -3
- package/front_end/models/bindings/CSSWorkspaceBinding.ts +8 -7
- package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +19 -15
- package/front_end/models/bindings/ResourceMapping.ts +57 -15
- package/front_end/models/live-metrics/LiveMetrics.ts +12 -20
- package/front_end/models/trace/handlers/SamplesHandler.ts +64 -6
- package/front_end/models/trace/types/TraceEvents.ts +16 -0
- package/front_end/models/workspace/IgnoreListManager.ts +10 -9
- package/front_end/models/workspace/WorkspaceImpl.ts +5 -10
- package/front_end/panels/accessibility/AccessibilityNodeView.ts +6 -2
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +1 -1
- package/front_end/panels/ai_assistance/components/ChatView.ts +2 -4
- package/front_end/panels/ai_assistance/components/PerformanceAgentMarkdownRenderer.ts +2 -1
- package/front_end/panels/animation/AnimationTimeline.ts +6 -6
- package/front_end/panels/application/ApplicationPanelSidebar.ts +0 -1
- package/front_end/panels/application/OpenedWindowDetailsView.ts +0 -2
- package/front_end/panels/application/ServiceWorkersView.ts +0 -2
- package/front_end/panels/application/StorageView.ts +0 -1
- package/front_end/panels/application/components/FrameDetailsView.ts +468 -447
- package/front_end/panels/application/components/ReportsGrid.ts +7 -2
- package/front_end/panels/application/components/SharedStorageAccessGrid.ts +5 -3
- package/front_end/panels/application/components/TrustTokensView.ts +7 -1
- package/front_end/panels/application/preloading/PreloadingView.ts +10 -4
- package/front_end/panels/application/preloading/components/PreloadingDisabledInfobar.ts +7 -11
- package/front_end/panels/application/preloading/components/UsedPreloadingView.ts +15 -3
- package/front_end/panels/browser_debugger/DOMBreakpointsSidebarPane.ts +12 -13
- package/front_end/panels/{elements → common}/DOMLinkifier.ts +6 -6
- package/front_end/panels/common/common.ts +1 -0
- package/front_end/panels/console/ConsoleView.ts +9 -7
- package/front_end/panels/console/ConsoleViewMessage.ts +23 -13
- package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +2 -1
- package/front_end/panels/elements/ElementsTreeElement.ts +3 -1
- package/front_end/panels/elements/StylePropertiesSection.ts +52 -15
- package/front_end/panels/elements/StylePropertyTreeElement.ts +8 -3
- package/front_end/panels/elements/StylesSidebarPane.ts +24 -14
- package/front_end/panels/elements/elements-meta.ts +11 -2
- package/front_end/panels/elements/elements.ts +0 -3
- package/front_end/panels/explain/components/ConsoleInsight.ts +333 -318
- package/front_end/panels/issues/AffectedResourcesView.ts +2 -1
- package/front_end/panels/lighthouse/LighthouseReportRenderer.ts +2 -1
- package/front_end/panels/network/NetworkLogView.ts +1 -1
- package/front_end/panels/recorder/RecorderController.ts +7 -1
- package/front_end/panels/settings/SettingsScreen.ts +3 -6
- package/front_end/panels/settings/components/SyncSection.ts +218 -226
- package/front_end/panels/settings/components/syncSection.css +81 -80
- package/front_end/panels/sources/AiCodeCompletionPlugin.ts +42 -294
- package/front_end/panels/sources/DebuggerPausedMessage.ts +3 -3
- package/front_end/panels/sources/DebuggerPlugin.ts +3 -1
- package/front_end/panels/sources/ResourceOriginPlugin.ts +7 -3
- package/front_end/panels/sources/SourcesPanel.ts +5 -1
- package/front_end/panels/timeline/TimelinePanel.ts +0 -21
- package/front_end/panels/timeline/TimelineUIUtils.ts +3 -2
- package/front_end/panels/timeline/components/LiveMetricsView.ts +7 -4
- package/front_end/panels/timeline/components/insights/NodeLink.ts +3 -2
- package/front_end/third_party/puppeteer/README.chromium +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/HTTPRequest.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/HTTPRequest.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/HTTPRequest.js +4 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/HTTPRequest.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/NetworkEventManager.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/NetworkEventManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/NetworkEventManager.js +8 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/NetworkEventManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/NetworkManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/NetworkManager.js +22 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/NetworkManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
- 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 +34 -6
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/HTTPRequest.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/HTTPRequest.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/HTTPRequest.js +4 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/HTTPRequest.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/NetworkEventManager.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/NetworkEventManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/NetworkEventManager.js +8 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/NetworkEventManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/NetworkManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/NetworkManager.js +22 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/NetworkManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.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 +2 -2
- package/front_end/third_party/puppeteer/package/src/cdp/HTTPRequest.ts +5 -1
- package/front_end/third_party/puppeteer/package/src/cdp/NetworkEventManager.ts +16 -1
- package/front_end/third_party/puppeteer/package/src/cdp/NetworkManager.ts +28 -0
- package/front_end/third_party/puppeteer/package/src/revisions.ts +3 -3
- package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
- package/front_end/ui/components/docs/component_docs.ts +0 -4
- package/front_end/ui/components/report_view/ReportView.ts +4 -1
- package/front_end/ui/components/text_editor/AiCodeCompletionProvider.ts +8 -5
- package/front_end/ui/i18n/i18n.ts +16 -0
- package/front_end/ui/legacy/ReportView.ts +0 -5
- package/front_end/ui/legacy/TextPrompt.ts +65 -19
- package/front_end/ui/legacy/UIUtils.ts +1 -1
- package/front_end/ui/legacy/Widget.ts +56 -25
- package/front_end/ui/legacy/XLink.ts +0 -2
- package/front_end/ui/legacy/components/object_ui/JavaScriptREPL.ts +8 -4
- package/front_end/ui/legacy/components/object_ui/ObjectPopoverHelper.ts +3 -1
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +239 -284
- package/front_end/ui/legacy/components/object_ui/RemoteObjectPreviewFormatter.ts +114 -184
- package/front_end/ui/legacy/components/utils/Linkifier.ts +1 -1
- package/front_end/ui/legacy/inspectorCommon.css +0 -4
- package/front_end/ui/{components/docs/theme_colors/basic.ts → legacy/theme_support/ThemeColors.docs.ts} +33 -23
- package/mcp/mcp.ts +1 -0
- package/package.json +1 -1
- package/front_end/core/common/QueryParamHandler.ts +0 -7
- package/front_end/ui/components/docs/input/basic.html +0 -31
- package/front_end/ui/components/docs/input/basic.ts +0 -12
- package/front_end/ui/components/docs/report/basic.html +0 -27
- package/front_end/ui/components/docs/report/basic.ts +0 -48
- package/front_end/ui/components/docs/theme_colors/basic.html +0 -56
- package/front_end/ui/components/docs/toggle_dark_mode.ts +0 -36
- package/front_end/ui/components/docs/toggle_fonts.ts +0 -74
- package/front_end/ui/components/docs/user_agent_client_hints/basic.html +0 -25
- package/front_end/ui/components/docs/user_agent_client_hints/basic.ts +0 -26
- package/front_end/ui/components/expandable_list/ExpandableList.docs.ts +0 -30
- /package/front_end/panels/{elements → common}/domLinkifier.css +0 -0
|
@@ -108,8 +108,13 @@ export const DEFAULT_VIEW = (input: ViewInput, output: undefined, target: HTMLEl
|
|
|
108
108
|
<span class="empty-state-header">${i18nString(UIStrings.noReportsToDisplay)}</span>
|
|
109
109
|
<div class="empty-state-description">
|
|
110
110
|
<span>${i18nString(UIStrings.reportingApiDescription)}</span>
|
|
111
|
-
|
|
112
|
-
|
|
111
|
+
<x-link
|
|
112
|
+
class="devtools-link"
|
|
113
|
+
href=${REPORTING_API_EXPLANATION_URL}
|
|
114
|
+
jslog=${VisualLogging.link()
|
|
115
|
+
.track({ click: true, keydown: 'Enter|Space' })
|
|
116
|
+
.context('learn-more')}
|
|
117
|
+
>${i18nString(UIStrings.learnMore)}</x-link>
|
|
113
118
|
</div>
|
|
114
119
|
</div>
|
|
115
120
|
`}
|
|
@@ -97,9 +97,11 @@ export const DEFAULT_VIEW: View = (input, _output, target) => {
|
|
|
97
97
|
<div class="empty-state-header">${i18nString(UIStrings.noEvents)}</div>
|
|
98
98
|
<div class="empty-state-description">
|
|
99
99
|
<span>${i18nString(UIStrings.sharedStorageDescription)}</span>
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
SHARED_STORAGE_EXPLANATION_URL
|
|
100
|
+
<x-link
|
|
101
|
+
class="x-link devtools-link"
|
|
102
|
+
href=${SHARED_STORAGE_EXPLANATION_URL}
|
|
103
|
+
jslog=${VisualLogging.link().track({click: true, keydown: 'Enter|Space'}).context('learn-more')}
|
|
104
|
+
>${i18nString(UIStrings.learnMore)}</x-link>
|
|
103
105
|
</div>
|
|
104
106
|
</div>`
|
|
105
107
|
: html`
|
|
@@ -115,7 +115,13 @@ export class TrustTokensView extends LegacyWrapper.LegacyWrapper.WrappableCompon
|
|
|
115
115
|
<div class="empty-state-header">${i18nString(UIStrings.noTrustTokens)}</div>
|
|
116
116
|
<div class="empty-state-description">
|
|
117
117
|
<span>${i18nString(UIStrings.trustTokensDescription)}</span>
|
|
118
|
-
|
|
118
|
+
<x-link
|
|
119
|
+
class="x-link devtools-link"
|
|
120
|
+
href=${PRIVATE_STATE_TOKENS_EXPLANATION_URL}
|
|
121
|
+
jslog=${VisualLogging.link()
|
|
122
|
+
.track({ click: true, keydown: 'Enter|Space' })
|
|
123
|
+
.context('learn-more')}
|
|
124
|
+
>${i18nString(UIStrings.learnMore)}</x-link>
|
|
119
125
|
</div>
|
|
120
126
|
</div>
|
|
121
127
|
`;
|
|
@@ -245,7 +245,11 @@ export class PreloadingRuleSetView extends UI.Widget.VBox {
|
|
|
245
245
|
<span class="empty-state-header">${i18nString(UIStrings.noRulesDetected)}</span>
|
|
246
246
|
<div class="empty-state-description">
|
|
247
247
|
<span>${i18nString(UIStrings.rulesDescription)}</span>
|
|
248
|
-
|
|
248
|
+
<x-link
|
|
249
|
+
class="x-link devtools-link"
|
|
250
|
+
href=${SPECULATION_EXPLANATION_URL}
|
|
251
|
+
jslog=${VisualLogging.link().track({click: true, keydown:'Enter|Space'}).context('learn-more')}
|
|
252
|
+
>${i18nString(UIStrings.learnMore)}</x-link>
|
|
249
253
|
</div>
|
|
250
254
|
</div>
|
|
251
255
|
<devtools-split-view sidebar-position="second">
|
|
@@ -402,9 +406,11 @@ export class PreloadingAttemptView extends UI.Widget.VBox {
|
|
|
402
406
|
<span class="empty-state-header">${i18nString(UIStrings.noPrefetchAttempts)}</span>
|
|
403
407
|
<div class="empty-state-description">
|
|
404
408
|
<span>${i18nString(UIStrings.prefetchDescription)}</span>
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
409
|
+
<x-link
|
|
410
|
+
class="x-link devtools-link"
|
|
411
|
+
href=${SPECULATION_EXPLANATION_URL}
|
|
412
|
+
jslog=${VisualLogging.link().track({click: true, keydown: 'Enter|Space'}).context('learn-more')}
|
|
413
|
+
>${i18nString(UIStrings.learnMore)}</x-link>
|
|
408
414
|
</div>
|
|
409
415
|
</div>
|
|
410
416
|
<devtools-split-view sidebar-position="second">
|
|
@@ -14,7 +14,7 @@ import * as Dialogs from '../../../../ui/components/dialogs/dialogs.js';
|
|
|
14
14
|
import * as LegacyWrapper from '../../../../ui/components/legacy_wrapper/legacy_wrapper.js';
|
|
15
15
|
import * as RenderCoordinator from '../../../../ui/components/render_coordinator/render_coordinator.js';
|
|
16
16
|
import * as uiI18n from '../../../../ui/i18n/i18n.js';
|
|
17
|
-
import * as UI from '../../../../ui/legacy/legacy.js';
|
|
17
|
+
import type * as UI from '../../../../ui/legacy/legacy.js';
|
|
18
18
|
import * as Lit from '../../../../ui/lit/lit.js';
|
|
19
19
|
import * as VisualLogging from '../../../../ui/visual_logging/visual_logging.js';
|
|
20
20
|
|
|
@@ -98,6 +98,8 @@ const str_ =
|
|
|
98
98
|
i18n.i18n.registerUIStrings('panels/application/preloading/components/PreloadingDisabledInfobar.ts', UIStrings);
|
|
99
99
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
100
100
|
|
|
101
|
+
const LINK = 'https://developer.chrome.com/blog/prerender-pages/';
|
|
102
|
+
|
|
101
103
|
export class PreloadingDisabledInfobar extends LegacyWrapper.LegacyWrapper.WrappableComponent<UI.Widget.VBox> {
|
|
102
104
|
readonly #shadow = this.attachShadow({mode: 'open'});
|
|
103
105
|
#data: Protocol.Preload.PreloadEnabledStateUpdatedEvent = {
|
|
@@ -168,14 +170,6 @@ export class PreloadingDisabledInfobar extends LegacyWrapper.LegacyWrapper.Wrapp
|
|
|
168
170
|
}
|
|
169
171
|
|
|
170
172
|
#dialogContents(): Lit.LitTemplate {
|
|
171
|
-
const LINK = 'https://developer.chrome.com/blog/prerender-pages/';
|
|
172
|
-
|
|
173
|
-
const learnMoreLink =
|
|
174
|
-
UI.XLink.XLink.create(LINK, i18nString(UIStrings.footerLearnMore), undefined, undefined, 'learn-more');
|
|
175
|
-
const iconLink = UI.Fragment.html`
|
|
176
|
-
<x-link class="icon-link devtools-link" tabindex="0" href="${LINK}"></x-link>
|
|
177
|
-
` as UI.XLink.XLink;
|
|
178
|
-
|
|
179
173
|
return html`
|
|
180
174
|
<div id='contents'>
|
|
181
175
|
<devtools-report>
|
|
@@ -186,8 +180,10 @@ export class PreloadingDisabledInfobar extends LegacyWrapper.LegacyWrapper.Wrapp
|
|
|
186
180
|
${this.#maybeDisableByHoldbackPrerenderSpeculationRules()}
|
|
187
181
|
</devtools-report>
|
|
188
182
|
<div id='footer'>
|
|
189
|
-
|
|
190
|
-
|
|
183
|
+
<x-link class="devtools-link" tabindex="0" href=${LINK}
|
|
184
|
+
jslog=${VisualLogging.link().track({click: true, keydown: 'Enter|Space'}).context('learn-more')}
|
|
185
|
+
>${i18nString(UIStrings.footerLearnMore)}</x-link>
|
|
186
|
+
<x-link class="icon-link devtools-link" tabindex="0" href=${LINK}></x-link>
|
|
191
187
|
</div>
|
|
192
188
|
</div>
|
|
193
189
|
`;
|
|
@@ -16,7 +16,7 @@ import * as SDK from '../../../../core/sdk/sdk.js';
|
|
|
16
16
|
import * as Protocol from '../../../../generated/protocol.js';
|
|
17
17
|
import * as LegacyWrapper from '../../../../ui/components/legacy_wrapper/legacy_wrapper.js';
|
|
18
18
|
import * as RenderCoordinator from '../../../../ui/components/render_coordinator/render_coordinator.js';
|
|
19
|
-
import * as UI from '../../../../ui/legacy/legacy.js';
|
|
19
|
+
import type * as UI from '../../../../ui/legacy/legacy.js';
|
|
20
20
|
import * as Lit from '../../../../ui/lit/lit.js';
|
|
21
21
|
import * as VisualLogging from '../../../../ui/visual_logging/visual_logging.js';
|
|
22
22
|
import * as PreloadingHelper from '../helper/helper.js';
|
|
@@ -176,7 +176,13 @@ export class UsedPreloadingView extends LegacyWrapper.LegacyWrapper.WrappableCom
|
|
|
176
176
|
<devtools-report-divider></devtools-report-divider>
|
|
177
177
|
|
|
178
178
|
<devtools-report-section>
|
|
179
|
-
|
|
179
|
+
<x-link
|
|
180
|
+
class="link devtools-link"
|
|
181
|
+
href=${'https://developer.chrome.com/blog/prerender-pages/'}
|
|
182
|
+
jslog=${VisualLogging.link()
|
|
183
|
+
.track({ click: true, keydown: 'Enter|Space' })
|
|
184
|
+
.context('learn-more')}
|
|
185
|
+
>${i18nString(UIStrings.learnMore)}</x-link>
|
|
180
186
|
</devtools-report-section>
|
|
181
187
|
</devtools-report>
|
|
182
188
|
`;
|
|
@@ -319,7 +325,13 @@ export class UsedPreloadingView extends LegacyWrapper.LegacyWrapper.WrappableCom
|
|
|
319
325
|
return html`
|
|
320
326
|
<devtools-report-section-header>${i18nString(UIStrings.currentURL)}</devtools-report-section-header>
|
|
321
327
|
<devtools-report-section>
|
|
322
|
-
|
|
328
|
+
<x-link
|
|
329
|
+
class="link devtools-link"
|
|
330
|
+
href=${this.#data.pageURL}
|
|
331
|
+
jslog=${VisualLogging.link()
|
|
332
|
+
.track({ click: true, keydown: 'Enter|Space' })
|
|
333
|
+
.context('current-url')}
|
|
334
|
+
>${this.#data.pageURL}</x-link>
|
|
323
335
|
</devtools-report-section>
|
|
324
336
|
|
|
325
337
|
<devtools-report-section-header>${i18nString(UIStrings.preloadedURLs)}</devtools-report-section-header>
|
|
@@ -11,6 +11,7 @@ import * as SDK from '../../core/sdk/sdk.js';
|
|
|
11
11
|
import * as Protocol from '../../generated/protocol.js';
|
|
12
12
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
13
13
|
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
14
|
+
import * as PanelsCommon from '../common/common.js';
|
|
14
15
|
import * as Sources from '../sources/sources.js';
|
|
15
16
|
|
|
16
17
|
import domBreakpointsSidebarPaneStyles from './domBreakpointsSidebarPane.css.js';
|
|
@@ -203,19 +204,17 @@ export class DOMBreakpointsSidebarPane extends UI.Widget.VBox implements
|
|
|
203
204
|
const linkifiedNode = document.createElement('monospace');
|
|
204
205
|
linkifiedNode.style.display = 'block';
|
|
205
206
|
labelElement.appendChild(linkifiedNode);
|
|
206
|
-
|
|
207
|
-
.
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
UIStrings.sSS, {PH1: breakpointTypeText, PH2: linkified.deepTextContent(), PH3: checkedStateText}));
|
|
218
|
-
});
|
|
207
|
+
const linkified = PanelsCommon.DOMLinkifier.Linkifier.instance().linkify(
|
|
208
|
+
item.node, {preventKeyboardFocus: true, tooltip: undefined});
|
|
209
|
+
linkifiedNode.appendChild(linkified);
|
|
210
|
+
// Give the checkbox an aria-label as it is required for all form element
|
|
211
|
+
UI.ARIAUtils.setLabel(
|
|
212
|
+
checkbox, i18nString(UIStrings.sS, {PH1: breakpointTypeText, PH2: linkified.deepTextContent()}));
|
|
213
|
+
// The parent list element is the one that actually gets focused.
|
|
214
|
+
// Assign it an aria-label with complete information for the screen reader to read out properly
|
|
215
|
+
UI.ARIAUtils.setLabel(
|
|
216
|
+
element,
|
|
217
|
+
i18nString(UIStrings.sSS, {PH1: breakpointTypeText, PH2: linkified.deepTextContent(), PH3: checkedStateText}));
|
|
219
218
|
|
|
220
219
|
labelElement.appendChild(description);
|
|
221
220
|
|
|
@@ -21,7 +21,7 @@ const UIStrings = {
|
|
|
21
21
|
*/
|
|
22
22
|
node: '<node>',
|
|
23
23
|
} as const;
|
|
24
|
-
const str_ = i18n.i18n.registerUIStrings('panels/
|
|
24
|
+
const str_ = i18n.i18n.registerUIStrings('panels/common/DOMLinkifier.ts', UIStrings);
|
|
25
25
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
26
26
|
|
|
27
27
|
export interface Options extends Common.Linkifier.Options {
|
|
@@ -247,15 +247,15 @@ export class Linkifier implements Common.Linkifier.Linkifier {
|
|
|
247
247
|
|
|
248
248
|
return linkifierInstance;
|
|
249
249
|
}
|
|
250
|
-
linkify(
|
|
251
|
-
if (
|
|
250
|
+
linkify(node: SDK.DOMModel.DOMNode|SDK.DOMModel.DeferredDOMNode, options?: Options): HTMLElement {
|
|
251
|
+
if (node instanceof SDK.DOMModel.DOMNode) {
|
|
252
252
|
const link = document.createElement('devtools-widget') as UI.Widget.WidgetElement<DOMNodeLink>;
|
|
253
|
-
link.widgetConfig = UI.Widget.widgetConfig(e => new DOMNodeLink(e,
|
|
253
|
+
link.widgetConfig = UI.Widget.widgetConfig(e => new DOMNodeLink(e, node, options));
|
|
254
254
|
return link;
|
|
255
255
|
}
|
|
256
|
-
if (
|
|
256
|
+
if (node instanceof SDK.DOMModel.DeferredDOMNode) {
|
|
257
257
|
const link = document.createElement('devtools-widget') as UI.Widget.WidgetElement<DeferredDOMNodeLink>;
|
|
258
|
-
link.widgetConfig = UI.Widget.widgetConfig(e => new DeferredDOMNodeLink(e,
|
|
258
|
+
link.widgetConfig = UI.Widget.widgetConfig(e => new DeferredDOMNodeLink(e, node, options));
|
|
259
259
|
return link;
|
|
260
260
|
}
|
|
261
261
|
throw new Error('Can\'t linkify non-node');
|
|
@@ -104,3 +104,4 @@ export * as ExtensionPanel from './ExtensionPanel.js';
|
|
|
104
104
|
export * as ExtensionServer from './ExtensionServer.js';
|
|
105
105
|
export * as ExtensionView from './ExtensionView.js';
|
|
106
106
|
export * as PersistenceUtils from './PersistenceUtils.js';
|
|
107
|
+
export * as DOMLinkifier from './DOMLinkifier.js';
|
|
@@ -1324,7 +1324,7 @@ export class ConsoleView extends UI.Widget.VBox implements
|
|
|
1324
1324
|
}
|
|
1325
1325
|
this.updateFilterStatus();
|
|
1326
1326
|
this.#searchableView.updateSearchMatchesCount(this.regexMatchRanges.length);
|
|
1327
|
-
this.
|
|
1327
|
+
this.highlightMatch(this.currentMatchRangeIndex, false); // Re-highlight current match without scrolling.
|
|
1328
1328
|
this.viewport.invalidate();
|
|
1329
1329
|
this.messagesCountElement.setAttribute(
|
|
1330
1330
|
'aria-label', i18nString(UIStrings.filteredMessagesInConsole, {PH1: this.visibleViewMessages.length}));
|
|
@@ -1564,7 +1564,7 @@ export class ConsoleView extends UI.Widget.VBox implements
|
|
|
1564
1564
|
|
|
1565
1565
|
this.#searchableView.updateSearchMatchesCount(this.regexMatchRanges.length);
|
|
1566
1566
|
if (typeof this.searchShouldJumpBackwards !== 'undefined' && this.regexMatchRanges.length) {
|
|
1567
|
-
this.
|
|
1567
|
+
this.highlightMatch(this.searchShouldJumpBackwards ? -1 : 0);
|
|
1568
1568
|
delete this.searchShouldJumpBackwards;
|
|
1569
1569
|
}
|
|
1570
1570
|
|
|
@@ -1589,11 +1589,11 @@ export class ConsoleView extends UI.Widget.VBox implements
|
|
|
1589
1589
|
}
|
|
1590
1590
|
|
|
1591
1591
|
jumpToNextSearchResult(): void {
|
|
1592
|
-
this.
|
|
1592
|
+
this.highlightMatch(this.currentMatchRangeIndex + 1);
|
|
1593
1593
|
}
|
|
1594
1594
|
|
|
1595
1595
|
jumpToPreviousSearchResult(): void {
|
|
1596
|
-
this.
|
|
1596
|
+
this.highlightMatch(this.currentMatchRangeIndex - 1);
|
|
1597
1597
|
}
|
|
1598
1598
|
|
|
1599
1599
|
supportsCaseSensitiveSearch(): boolean {
|
|
@@ -1608,7 +1608,7 @@ export class ConsoleView extends UI.Widget.VBox implements
|
|
|
1608
1608
|
return true;
|
|
1609
1609
|
}
|
|
1610
1610
|
|
|
1611
|
-
private
|
|
1611
|
+
private highlightMatch(index: number, scrollIntoView = true): void {
|
|
1612
1612
|
if (!this.regexMatchRanges.length) {
|
|
1613
1613
|
return;
|
|
1614
1614
|
}
|
|
@@ -1628,8 +1628,10 @@ export class ConsoleView extends UI.Widget.VBox implements
|
|
|
1628
1628
|
const message = this.visibleViewMessages[matchRange.messageIndex];
|
|
1629
1629
|
const highlightNode = message.searchHighlightNode(matchRange.matchIndex);
|
|
1630
1630
|
highlightNode.classList.add(UI.UIUtils.highlightedCurrentSearchResultClassName);
|
|
1631
|
-
|
|
1632
|
-
|
|
1631
|
+
if (scrollIntoView) {
|
|
1632
|
+
this.viewport.scrollItemIntoView(matchRange.messageIndex);
|
|
1633
|
+
highlightNode.scrollIntoViewIfNeeded();
|
|
1634
|
+
}
|
|
1633
1635
|
}
|
|
1634
1636
|
|
|
1635
1637
|
private updateStickToBottomOnPointerDown(isRightClick?: boolean): void {
|
|
@@ -58,6 +58,7 @@ import * as ObjectUI from '../../ui/legacy/components/object_ui/object_ui.js';
|
|
|
58
58
|
import objectValueStyles from '../../ui/legacy/components/object_ui/objectValue.css.js';
|
|
59
59
|
import * as Components from '../../ui/legacy/components/utils/utils.js';
|
|
60
60
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
61
|
+
import {render} from '../../ui/lit/lit.js';
|
|
61
62
|
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
62
63
|
import * as Security from '../security/security.js';
|
|
63
64
|
|
|
@@ -842,8 +843,8 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
|
|
|
842
843
|
const result = document.createElement('span');
|
|
843
844
|
const description = obj.description || '';
|
|
844
845
|
if (description.length > getMaxTokenizableStringLength()) {
|
|
845
|
-
const propertyValue =
|
|
846
|
-
|
|
846
|
+
const propertyValue =
|
|
847
|
+
new ObjectUI.ObjectPropertiesSection.ExpandableTextPropertyValue(description, getLongStringVisibleLength());
|
|
847
848
|
result.appendChild(propertyValue.element);
|
|
848
849
|
} else {
|
|
849
850
|
UI.UIUtils.createTextChild(result, description);
|
|
@@ -867,7 +868,8 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
|
|
|
867
868
|
titleElement.classList.add('console-object');
|
|
868
869
|
if (includePreview && obj.preview) {
|
|
869
870
|
titleElement.classList.add('console-object-preview');
|
|
870
|
-
|
|
871
|
+
/* eslint-disable-next-line @devtools/no-lit-render-outside-of-view */
|
|
872
|
+
render(this.previewFormatter.renderObjectPreview(obj.preview), titleElement);
|
|
871
873
|
ObjectUI.ObjectPropertiesSection.ObjectPropertiesSection.appendMemoryIcon(titleElement, obj);
|
|
872
874
|
} else if (obj.type === 'function') {
|
|
873
875
|
const functionElement = titleElement.createChild('span');
|
|
@@ -935,11 +937,11 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
|
|
|
935
937
|
protected renderPropertyPreviewOrAccessor(
|
|
936
938
|
object: SDK.RemoteObject.RemoteObject|null, property: Protocol.Runtime.PropertyPreview, propertyPath: Array<{
|
|
937
939
|
name: (string | symbol),
|
|
938
|
-
}>): HTMLElement {
|
|
940
|
+
}>): DocumentFragment|HTMLElement {
|
|
939
941
|
if (property.type === 'accessor') {
|
|
940
942
|
return this.formatAsAccessorProperty(object, propertyPath.map(property => property.name.toString()), false);
|
|
941
943
|
}
|
|
942
|
-
return this.
|
|
944
|
+
return this.renderPropertyPreview(
|
|
943
945
|
property.type, 'subtype' in property ? property.subtype : undefined, null, property.value);
|
|
944
946
|
}
|
|
945
947
|
|
|
@@ -1022,9 +1024,17 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
|
|
|
1022
1024
|
return result;
|
|
1023
1025
|
}
|
|
1024
1026
|
|
|
1025
|
-
private formatAsArrayEntry(output: SDK.RemoteObject.RemoteObject):
|
|
1026
|
-
return this.
|
|
1027
|
-
|
|
1027
|
+
private formatAsArrayEntry(output: SDK.RemoteObject.RemoteObject): DocumentFragment {
|
|
1028
|
+
return this.renderPropertyPreview(output.type, output.subtype, output.className, output.description);
|
|
1029
|
+
}
|
|
1030
|
+
|
|
1031
|
+
private renderPropertyPreview(
|
|
1032
|
+
type: string, subtype: string|undefined, className: string|null|undefined,
|
|
1033
|
+
description: string|undefined): DocumentFragment {
|
|
1034
|
+
const fragment = document.createDocumentFragment();
|
|
1035
|
+
/* eslint-disable-next-line @devtools/no-lit-render-outside-of-view */
|
|
1036
|
+
render(this.previewFormatter.renderPropertyPreview(type, subtype, className, description), fragment);
|
|
1037
|
+
return fragment;
|
|
1028
1038
|
}
|
|
1029
1039
|
|
|
1030
1040
|
private formatAsAccessorProperty(
|
|
@@ -1059,8 +1069,7 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
|
|
|
1059
1069
|
description = Platform.StringUtilities.trimEndWithMaxLength(object.description, maxLength);
|
|
1060
1070
|
}
|
|
1061
1071
|
}
|
|
1062
|
-
rootElement.appendChild(
|
|
1063
|
-
this.previewFormatter.renderPropertyPreview(type, subtype, object.className, description));
|
|
1072
|
+
rootElement.appendChild(this.renderPropertyPreview(type, subtype, object.className, description));
|
|
1064
1073
|
}
|
|
1065
1074
|
}
|
|
1066
1075
|
|
|
@@ -1880,8 +1889,8 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
|
|
|
1880
1889
|
linkifier: (arg0: string, arg1: Platform.DevToolsPath.UrlString, arg2?: number, arg3?: number) => Node):
|
|
1881
1890
|
DocumentFragment {
|
|
1882
1891
|
if (string.length > getMaxTokenizableStringLength()) {
|
|
1883
|
-
const propertyValue =
|
|
1884
|
-
|
|
1892
|
+
const propertyValue =
|
|
1893
|
+
new ObjectUI.ObjectPropertiesSection.ExpandableTextPropertyValue(string, getLongStringVisibleLength());
|
|
1885
1894
|
const fragment = document.createDocumentFragment();
|
|
1886
1895
|
fragment.appendChild(propertyValue.element);
|
|
1887
1896
|
return fragment;
|
|
@@ -2253,7 +2262,8 @@ export class ConsoleTableMessageView extends ConsoleViewMessage {
|
|
|
2253
2262
|
|
|
2254
2263
|
if (columnRendered) {
|
|
2255
2264
|
const cellElement =
|
|
2256
|
-
this.renderPropertyPreviewOrAccessor(actualTable, cellProperty, [rowProperty, cellProperty])
|
|
2265
|
+
this.renderPropertyPreviewOrAccessor(actualTable, cellProperty, [rowProperty, cellProperty])
|
|
2266
|
+
.firstElementChild as HTMLElement;
|
|
2257
2267
|
cellElement.classList.add('console-message-nowrap-below');
|
|
2258
2268
|
rowValue.set(cellProperty.name, cellElement);
|
|
2259
2269
|
}
|
|
@@ -17,6 +17,7 @@ import * as Components from '../../ui/legacy/components/utils/utils.js';
|
|
|
17
17
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
18
18
|
import {Directives, html, type LitTemplate, nothing, render, type TemplateResult} from '../../ui/lit/lit.js';
|
|
19
19
|
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
20
|
+
import * as PanelsCommon from '../common/common.js';
|
|
20
21
|
|
|
21
22
|
import cssOverviewCompletedViewStyles from './cssOverviewCompletedView.css.js';
|
|
22
23
|
import type {GlobalStyleStats} from './CSSOverviewModel.js';
|
|
@@ -984,7 +985,7 @@ export class ElementDetailsView extends UI.Widget.Widget {
|
|
|
984
985
|
if ('nodeId' in item && visibility.has('node-id')) {
|
|
985
986
|
const frontendNode = relatedNodesMap?.get(item.nodeId) ?? null;
|
|
986
987
|
if (frontendNode) {
|
|
987
|
-
link =
|
|
988
|
+
link = PanelsCommon.DOMLinkifier.Linkifier.instance().linkify(frontendNode);
|
|
988
989
|
showNode = () => frontendNode.scrollIntoView();
|
|
989
990
|
}
|
|
990
991
|
}
|
|
@@ -56,6 +56,7 @@ import * as Components from '../../ui/legacy/components/utils/utils.js';
|
|
|
56
56
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
57
57
|
import * as Lit from '../../ui/lit/lit.js';
|
|
58
58
|
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
59
|
+
import * as PanelsCommon from '../common/common.js';
|
|
59
60
|
import * as Emulation from '../emulation/emulation.js';
|
|
60
61
|
import * as Media from '../media/media.js';
|
|
61
62
|
|
|
@@ -66,6 +67,7 @@ import {ElementsPanel} from './ElementsPanel.js';
|
|
|
66
67
|
import {type ElementsTreeOutline, MappedCharToEntity} from './ElementsTreeOutline.js';
|
|
67
68
|
import {ImagePreviewPopover} from './ImagePreviewPopover.js';
|
|
68
69
|
import {getRegisteredDecorators, type MarkerDecorator, type MarkerDecoratorRegistration} from './MarkerDecorator.js';
|
|
70
|
+
|
|
69
71
|
const {html, nothing, render, Directives: {ref, repeat}} = Lit;
|
|
70
72
|
|
|
71
73
|
const UIStrings = {
|
|
@@ -2149,7 +2151,7 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
2149
2151
|
if (!relatedElement) {
|
|
2150
2152
|
return;
|
|
2151
2153
|
}
|
|
2152
|
-
const link =
|
|
2154
|
+
const link = PanelsCommon.DOMLinkifier.Linkifier.instance().linkify(relatedElement, {
|
|
2153
2155
|
preventKeyboardFocus: true,
|
|
2154
2156
|
tooltip,
|
|
2155
2157
|
textContent: linkContainer.textContent || undefined,
|
|
@@ -49,10 +49,10 @@ import * as Tooltips from '../../ui/components/tooltips/tooltips.js';
|
|
|
49
49
|
import type * as Components from '../../ui/legacy/components/utils/utils.js';
|
|
50
50
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
51
51
|
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
52
|
+
import * as PanelsCommon from '../common/common.js';
|
|
52
53
|
|
|
53
54
|
import {FontEditorSectionManager} from './ColorSwatchPopoverIcon.js';
|
|
54
55
|
import * as ElementsComponents from './components/components.js';
|
|
55
|
-
import {DeferredDOMNodeLink} from './DOMLinkifier.js';
|
|
56
56
|
import {ElementsPanel} from './ElementsPanel.js';
|
|
57
57
|
import stylePropertiesTreeOutlineStyles from './stylePropertiesTreeOutline.css.js';
|
|
58
58
|
import {type Context, StylePropertyTreeElement} from './StylePropertyTreeElement.js';
|
|
@@ -402,8 +402,10 @@ export class StylePropertiesSection {
|
|
|
402
402
|
|
|
403
403
|
function linkifyNode(label: string): Node|null {
|
|
404
404
|
if (header?.ownerNode) {
|
|
405
|
-
const link = document.createElement('devtools-widget') as
|
|
406
|
-
|
|
405
|
+
const link = document.createElement('devtools-widget') as
|
|
406
|
+
UI.Widget.WidgetElement<PanelsCommon.DOMLinkifier.DeferredDOMNodeLink>;
|
|
407
|
+
link.widgetConfig =
|
|
408
|
+
UI.Widget.widgetConfig(e => new PanelsCommon.DOMLinkifier.DeferredDOMNodeLink(e, header.ownerNode));
|
|
407
409
|
link.textContent = label;
|
|
408
410
|
return link;
|
|
409
411
|
}
|
|
@@ -633,6 +635,17 @@ export class StylePropertiesSection {
|
|
|
633
635
|
if (this.styleInternal.parentRule instanceof SDK.CSSRule.CSSStyleRule) {
|
|
634
636
|
return this.styleInternal.parentRule.selectorText();
|
|
635
637
|
}
|
|
638
|
+
if (this.styleInternal.parentRule instanceof SDK.CSSRule.CSSAtRule) {
|
|
639
|
+
if (this.styleInternal.parentRule.subsection()) {
|
|
640
|
+
return '@' + this.styleInternal.parentRule.subsection();
|
|
641
|
+
}
|
|
642
|
+
const atRule = '@' + this.styleInternal.parentRule.type();
|
|
643
|
+
const name = this.styleInternal.parentRule.name();
|
|
644
|
+
if (name) {
|
|
645
|
+
return atRule + ' ' + name.text;
|
|
646
|
+
}
|
|
647
|
+
return atRule;
|
|
648
|
+
}
|
|
636
649
|
return '';
|
|
637
650
|
}
|
|
638
651
|
|
|
@@ -813,11 +826,36 @@ export class StylePropertiesSection {
|
|
|
813
826
|
// We reduce one level since no selector means one less pair of braces are added for declarations.
|
|
814
827
|
this.nestingLevel--;
|
|
815
828
|
}
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
protected createAtRuleAncestor(rule: SDK.CSSRule.CSSAtRule): void {
|
|
832
|
+
if (rule.subsection()) {
|
|
833
|
+
const atRuleElement = new ElementsComponents.CSSQuery.CSSQuery();
|
|
834
|
+
atRuleElement.data = {
|
|
835
|
+
queryPrefix: '@' + rule.type(),
|
|
836
|
+
queryText: rule.name()?.text ?? '',
|
|
837
|
+
jslogContext: 'at-rule-' + rule.type(),
|
|
838
|
+
};
|
|
816
839
|
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
this.
|
|
820
|
-
|
|
840
|
+
this.#ancestorRuleListElement.prepend(atRuleElement);
|
|
841
|
+
this.#ancestorClosingBracesElement.prepend(this.indentElement(this.createClosingBrace(), 0));
|
|
842
|
+
this.nestingLevel++;
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
protected maybeCreateAncestorRules(style: SDK.CSSStyleDeclaration.CSSStyleDeclaration): void {
|
|
847
|
+
if (style.parentRule) {
|
|
848
|
+
if (style.parentRule instanceof SDK.CSSRule.CSSStyleRule) {
|
|
849
|
+
this.createAncestorRules(style.parentRule);
|
|
850
|
+
} else if (style.parentRule instanceof SDK.CSSRule.CSSAtRule) {
|
|
851
|
+
this.createAtRuleAncestor(style.parentRule);
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
let curNestingLevel = 0;
|
|
855
|
+
for (const element of this.#ancestorRuleListElement.children) {
|
|
856
|
+
this.indentElement(element as HTMLElement, curNestingLevel);
|
|
857
|
+
curNestingLevel++;
|
|
858
|
+
}
|
|
821
859
|
}
|
|
822
860
|
}
|
|
823
861
|
|
|
@@ -994,9 +1032,7 @@ export class StylePropertiesSection {
|
|
|
994
1032
|
private updateAncestorRuleList(): void {
|
|
995
1033
|
this.#ancestorRuleListElement.removeChildren();
|
|
996
1034
|
this.#ancestorClosingBracesElement.removeChildren();
|
|
997
|
-
|
|
998
|
-
this.createAncestorRules(this.styleInternal.parentRule);
|
|
999
|
-
}
|
|
1035
|
+
this.maybeCreateAncestorRules(this.styleInternal);
|
|
1000
1036
|
this.#styleRuleElement.style.paddingLeft = `${this.nestingLevel}ch`;
|
|
1001
1037
|
}
|
|
1002
1038
|
|
|
@@ -1640,9 +1676,7 @@ export class BlankStylePropertiesSection extends StylePropertiesSection {
|
|
|
1640
1676
|
this.selectorRefElement.removeChildren();
|
|
1641
1677
|
this.selectorRefElement.appendChild(StylePropertiesSection.linkifyRuleLocation(
|
|
1642
1678
|
cssModel, this.parentPane.linkifier, styleSheetHeader, this.actualRuleLocation()));
|
|
1643
|
-
|
|
1644
|
-
this.createAncestorRules(insertAfterStyle.parentRule);
|
|
1645
|
-
}
|
|
1679
|
+
this.maybeCreateAncestorRules(insertAfterStyle);
|
|
1646
1680
|
this.element.classList.add('blank-section');
|
|
1647
1681
|
}
|
|
1648
1682
|
|
|
@@ -1830,12 +1864,15 @@ export class FunctionRuleSection extends StylePropertiesSection {
|
|
|
1830
1864
|
}
|
|
1831
1865
|
}
|
|
1832
1866
|
|
|
1833
|
-
export class
|
|
1867
|
+
export class AtRuleSection extends StylePropertiesSection {
|
|
1834
1868
|
constructor(
|
|
1835
1869
|
stylesPane: StylesSidebarPane, matchedStyles: SDK.CSSMatchedStyles.CSSMatchedStyles,
|
|
1836
|
-
style: SDK.CSSStyleDeclaration.CSSStyleDeclaration, sectionIdx: number) {
|
|
1870
|
+
style: SDK.CSSStyleDeclaration.CSSStyleDeclaration, sectionIdx: number, expandedByDefault: boolean) {
|
|
1837
1871
|
super(stylesPane, matchedStyles, style, sectionIdx, null, null);
|
|
1838
1872
|
this.selectorElement.className = 'font-palette-values-key';
|
|
1873
|
+
if (!expandedByDefault) {
|
|
1874
|
+
this.element.classList.add('hidden');
|
|
1875
|
+
}
|
|
1839
1876
|
}
|
|
1840
1877
|
}
|
|
1841
1878
|
|
|
@@ -1088,8 +1088,9 @@ export class LinkableNameRenderer extends rendererBase(SDK.CSSPropertyParserMatc
|
|
|
1088
1088
|
return {
|
|
1089
1089
|
jslogContext: 'css-font-palette',
|
|
1090
1090
|
metric: null,
|
|
1091
|
-
ruleBlock: '@font
|
|
1092
|
-
isDefined: this.#matchedStyles.
|
|
1091
|
+
ruleBlock: '@font-*',
|
|
1092
|
+
isDefined: Boolean(this.#matchedStyles.atRules().find(
|
|
1093
|
+
ar => ar.type() === 'font-palette-values' && ar.name()?.text === match.text)),
|
|
1093
1094
|
};
|
|
1094
1095
|
case SDK.CSSPropertyParserMatchers.LinkableNameProperties.POSITION_TRY:
|
|
1095
1096
|
case SDK.CSSPropertyParserMatchers.LinkableNameProperties.POSITION_TRY_FALLBACKS:
|
|
@@ -1111,7 +1112,11 @@ export class LinkableNameRenderer extends rendererBase(SDK.CSSPropertyParserMatc
|
|
|
1111
1112
|
isDefined,
|
|
1112
1113
|
onLinkActivate: (): void => {
|
|
1113
1114
|
metric && Host.userMetrics.swatchActivated(metric);
|
|
1114
|
-
|
|
1115
|
+
if (match.propertyName === SDK.CSSPropertyParserMatchers.LinkableNameProperties.FONT_PALETTE) {
|
|
1116
|
+
this.#stylesPane.jumpToFontPaletteDefinition(match.text);
|
|
1117
|
+
} else {
|
|
1118
|
+
this.#stylesPane.jumpToSectionBlock(`${ruleBlock} ${match.text}`);
|
|
1119
|
+
}
|
|
1115
1120
|
},
|
|
1116
1121
|
jslogContext,
|
|
1117
1122
|
};
|