chrome-devtools-frontend 1.0.1543472 → 1.0.1545096
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 +1 -0
- package/config/typescript/tsconfig.eslint.json +1 -0
- package/front_end/core/common/ParsedURL.ts +1 -1
- 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/protocol_client/CDPConnection.ts +3 -3
- package/front_end/core/protocol_client/DevToolsCDPConnection.ts +2 -1
- package/front_end/core/root/Runtime.ts +8 -7
- package/front_end/core/sdk/CPUThrottlingManager.ts +0 -4
- package/front_end/core/sdk/CSSMatchedStyles.ts +7 -9
- package/front_end/core/sdk/CSSMetadata.ts +17 -5
- 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/NetworkManager.ts +6 -8
- package/front_end/core/sdk/NetworkRequest.ts +4 -0
- package/front_end/core/sdk/SDKModel.ts +4 -2
- package/front_end/core/sdk/TargetManager.ts +14 -15
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshotLoader.ts +2 -0
- package/front_end/entrypoints/main/MainImpl.ts +0 -16
- package/front_end/foundation/Universe.ts +12 -1
- package/front_end/generated/Deprecation.ts +4 -0
- package/front_end/generated/InspectorBackendCommands.ts +2 -5
- package/front_end/generated/SupportedCSSProperties.js +0 -23
- package/front_end/generated/protocol-mapping.d.ts +0 -15
- package/front_end/generated/protocol-proxy-api.d.ts +0 -11
- package/front_end/generated/protocol.ts +2 -34
- 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 +9 -8
- package/front_end/models/bindings/ResourceMapping.ts +57 -15
- package/front_end/models/live-metrics/LiveMetrics.ts +12 -20
- package/front_end/panels/accessibility/AccessibilityNodeView.ts +6 -2
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +3 -2
- 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/ai_assistance/components/UserActionRow.ts +2 -1
- package/front_end/panels/animation/AnimationTimeline.ts +6 -6
- package/front_end/panels/application/ApplicationPanelSidebar.ts +6 -7
- package/front_end/panels/application/{components/FrameDetailsView.ts → FrameDetailsView.ts} +134 -165
- package/front_end/panels/application/{components/OriginTrialTreeView.ts → OriginTrialTreeView.ts} +9 -9
- package/front_end/panels/application/application.ts +4 -0
- 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/StackTrace.ts +5 -3
- package/front_end/panels/application/components/TrustTokensView.ts +7 -1
- package/front_end/panels/application/components/components.ts +2 -4
- package/front_end/panels/application/{components/frameDetailsReportView.css → frameDetailsReportView.css} +5 -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/common/BadgeNotification.ts +2 -1
- package/front_end/panels/{elements → common}/DOMLinkifier.ts +13 -8
- package/front_end/panels/common/GdpSignUpDialog.ts +2 -1
- package/front_end/panels/common/common.ts +1 -0
- package/front_end/panels/console/ConsoleViewMessage.ts +4 -4
- package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +2 -1
- package/front_end/panels/elements/ElementStatePaneWidget.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 +0 -13
- package/front_end/panels/elements/elements.ts +0 -3
- package/front_end/panels/explain/components/ConsoleInsight.ts +31 -20
- package/front_end/panels/issues/AffectedResourcesView.ts +2 -1
- package/front_end/panels/lighthouse/LighthouseProtocolService.ts +3 -6
- 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/FrameworkIgnoreListSettingsTab.ts +2 -1
- package/front_end/panels/settings/SettingsScreen.ts +3 -2
- package/front_end/panels/sources/AiCodeCompletionPlugin.ts +42 -294
- package/front_end/panels/sources/DebuggerPausedMessage.ts +3 -3
- package/front_end/panels/sources/SourcesPanel.ts +5 -1
- package/front_end/panels/timeline/TimelineUIUtils.ts +3 -2
- package/front_end/panels/timeline/components/LiveMetricsView.ts +18 -6
- package/front_end/panels/timeline/components/MetricCard.ts +2 -2
- package/front_end/panels/timeline/components/insights/NodeLink.ts +4 -4
- package/front_end/panels/timeline/overlays/components/EntryLabelOverlay.ts +2 -1
- package/front_end/panels/timeline/timeline-meta.ts +0 -10
- package/front_end/panels/timeline/timeline.ts +0 -2
- package/front_end/panels/whats_new/ReleaseNoteView.ts +2 -1
- package/front_end/panels/whats_new/WhatsNewImpl.ts +3 -2
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/puppeteer/README.chromium +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/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/tsconfig.json +1 -0
- package/front_end/ui/components/buttons/Button.docs.ts +6 -5
- package/front_end/ui/components/snackbars/Snackbars.docs.ts +1 -1
- package/front_end/ui/components/spinners/Spinners.docs.ts +1 -1
- package/front_end/ui/components/survey_link/SurveyLink.docs.ts +2 -1
- package/front_end/ui/components/switch/Switch.docs.ts +1 -1
- package/front_end/ui/components/text_editor/AiCodeCompletionProvider.ts +8 -5
- package/front_end/ui/components/tooltips/Tooltip.docs.ts +3 -3
- package/front_end/ui/helpers/OpenInNewTab.ts +87 -0
- package/front_end/ui/helpers/helpers.ts +5 -0
- package/front_end/ui/i18n/i18n.ts +16 -0
- package/front_end/ui/legacy/ContextMenu.docs.ts +12 -11
- package/front_end/ui/legacy/RadioButton.docs.ts +1 -1
- package/front_end/ui/legacy/SelectMenu.docs.ts +1 -1
- package/front_end/ui/legacy/Slider.docs.ts +1 -1
- package/front_end/ui/legacy/UIUtils.ts +1 -34
- package/front_end/ui/legacy/Widget.ts +56 -25
- package/front_end/ui/legacy/XLink.ts +4 -6
- package/front_end/ui/legacy/components/color_picker/ContrastDetails.ts +2 -1
- package/front_end/ui/legacy/components/object_ui/ObjectPopoverHelper.ts +3 -1
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +294 -336
- package/front_end/ui/legacy/components/utils/Linkifier.ts +2 -1
- package/front_end/ui/legacy/inspectorCommon.css +0 -4
- package/mcp/mcp.ts +1 -0
- package/mcp/tsconfig.json +16 -0
- package/package.json +2 -2
- package/front_end/core/common/Linkifier.ts +0 -55
- package/front_end/panels/timeline/CLSLinkifier.ts +0 -58
- package/front_end/ui/components/expandable_list/ExpandableList.docs.ts +0 -30
- /package/front_end/panels/application/{components/originTrialTokenRows.css → originTrialTokenRows.css} +0 -0
- /package/front_end/panels/application/{components/originTrialTreeView.css → originTrialTreeView.css} +0 -0
- /package/front_end/panels/{elements → common}/domLinkifier.css +0 -0
|
@@ -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
|
|
|
@@ -7,6 +7,7 @@ import * as Host from '../../core/host/host.js';
|
|
|
7
7
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
8
8
|
import * as Badges from '../../models/badges/badges.js';
|
|
9
9
|
import * as Buttons from '../../ui/components/buttons/buttons.js';
|
|
10
|
+
import * as UIHelpers from '../../ui/helpers/helpers.js';
|
|
10
11
|
import * as uiI18n from '../../ui/i18n/i18n.js';
|
|
11
12
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
12
13
|
import * as Lit from '../../ui/lit/lit.js';
|
|
@@ -290,7 +291,7 @@ export class BadgeNotification extends UI.Widget.Widget {
|
|
|
290
291
|
label: i18nString(UIStrings.viewProfile),
|
|
291
292
|
jslogContext: 'view-profile',
|
|
292
293
|
onClick: () => {
|
|
293
|
-
|
|
294
|
+
UIHelpers.openInNewTab(Host.GdpClient.GOOGLE_DEVELOPER_PROGRAM_PROFILE_LINK);
|
|
294
295
|
}
|
|
295
296
|
}
|
|
296
297
|
],
|
|
@@ -21,10 +21,15 @@ 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
|
-
export interface Options
|
|
27
|
+
export interface Options {
|
|
28
|
+
tooltip?: string;
|
|
29
|
+
preventKeyboardFocus?: boolean;
|
|
30
|
+
textContent?: string;
|
|
31
|
+
// Dynamic links include hyperlinks and anchorlinks -- links that navigate the content.
|
|
32
|
+
isDynamicLink?: boolean;
|
|
28
33
|
hiddenClassList?: string[];
|
|
29
34
|
disabled?: boolean;
|
|
30
35
|
}
|
|
@@ -236,7 +241,7 @@ export class DeferredDOMNodeLink extends UI.Widget.Widget {
|
|
|
236
241
|
|
|
237
242
|
let linkifierInstance: Linkifier;
|
|
238
243
|
|
|
239
|
-
export class Linkifier
|
|
244
|
+
export class Linkifier {
|
|
240
245
|
static instance(opts: {
|
|
241
246
|
forceNew: boolean|null,
|
|
242
247
|
} = {forceNew: null}): Linkifier {
|
|
@@ -247,15 +252,15 @@ export class Linkifier implements Common.Linkifier.Linkifier {
|
|
|
247
252
|
|
|
248
253
|
return linkifierInstance;
|
|
249
254
|
}
|
|
250
|
-
linkify(
|
|
251
|
-
if (
|
|
255
|
+
linkify(node: SDK.DOMModel.DOMNode|SDK.DOMModel.DeferredDOMNode, options?: Options): HTMLElement {
|
|
256
|
+
if (node instanceof SDK.DOMModel.DOMNode) {
|
|
252
257
|
const link = document.createElement('devtools-widget') as UI.Widget.WidgetElement<DOMNodeLink>;
|
|
253
|
-
link.widgetConfig = UI.Widget.widgetConfig(e => new DOMNodeLink(e,
|
|
258
|
+
link.widgetConfig = UI.Widget.widgetConfig(e => new DOMNodeLink(e, node, options));
|
|
254
259
|
return link;
|
|
255
260
|
}
|
|
256
|
-
if (
|
|
261
|
+
if (node instanceof SDK.DOMModel.DeferredDOMNode) {
|
|
257
262
|
const link = document.createElement('devtools-widget') as UI.Widget.WidgetElement<DeferredDOMNodeLink>;
|
|
258
|
-
link.widgetConfig = UI.Widget.widgetConfig(e => new DeferredDOMNodeLink(e,
|
|
263
|
+
link.widgetConfig = UI.Widget.widgetConfig(e => new DeferredDOMNodeLink(e, node, options));
|
|
259
264
|
return link;
|
|
260
265
|
}
|
|
261
266
|
throw new Error('Can\'t linkify non-node');
|
|
@@ -12,6 +12,7 @@ import * as Geometry from '../../models/geometry/geometry.js';
|
|
|
12
12
|
import * as Buttons from '../../ui/components/buttons/buttons.js';
|
|
13
13
|
import * as Snackbars from '../../ui/components/snackbars/snackbars.js';
|
|
14
14
|
import type * as Switch from '../../ui/components/switch/switch.js';
|
|
15
|
+
import * as UIHelpers from '../../ui/helpers/helpers.js';
|
|
15
16
|
import * as uiI18n from '../../ui/i18n/i18n.js';
|
|
16
17
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
17
18
|
import {html, render} from '../../ui/lit/lit.js';
|
|
@@ -168,7 +169,7 @@ export const DEFAULT_VIEW: View = (input, _output, target): void => {
|
|
|
168
169
|
.title=${i18nString(UIStrings.learnMoreAccessibleText)}
|
|
169
170
|
.variant=${Buttons.Button.Variant.OUTLINED}
|
|
170
171
|
.jslogContext=${'learn-more'}
|
|
171
|
-
@click=${() =>
|
|
172
|
+
@click=${() => UIHelpers.openInNewTab(GDP_PROGRAM_URL as Platform.DevToolsPath.UrlString)}>${i18nString(UIStrings.learnMore)}</devtools-button>
|
|
172
173
|
<div class="right-buttons">
|
|
173
174
|
<devtools-button
|
|
174
175
|
.variant=${Buttons.Button.Variant.TONAL}
|
|
@@ -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';
|
|
@@ -843,8 +843,8 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
|
|
|
843
843
|
const result = document.createElement('span');
|
|
844
844
|
const description = obj.description || '';
|
|
845
845
|
if (description.length > getMaxTokenizableStringLength()) {
|
|
846
|
-
const propertyValue =
|
|
847
|
-
|
|
846
|
+
const propertyValue =
|
|
847
|
+
new ObjectUI.ObjectPropertiesSection.ExpandableTextPropertyValue(description, getLongStringVisibleLength());
|
|
848
848
|
result.appendChild(propertyValue.element);
|
|
849
849
|
} else {
|
|
850
850
|
UI.UIUtils.createTextChild(result, description);
|
|
@@ -1889,8 +1889,8 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
|
|
|
1889
1889
|
linkifier: (arg0: string, arg1: Platform.DevToolsPath.UrlString, arg2?: number, arg3?: number) => Node):
|
|
1890
1890
|
DocumentFragment {
|
|
1891
1891
|
if (string.length > getMaxTokenizableStringLength()) {
|
|
1892
|
-
const propertyValue =
|
|
1893
|
-
|
|
1892
|
+
const propertyValue =
|
|
1893
|
+
new ObjectUI.ObjectPropertiesSection.ExpandableTextPropertyValue(string, getLongStringVisibleLength());
|
|
1894
1894
|
const fragment = document.createDocumentFragment();
|
|
1895
1895
|
fragment.appendChild(propertyValue.element);
|
|
1896
1896
|
return fragment;
|
|
@@ -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
|
}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
6
6
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
7
7
|
import * as Buttons from '../../ui/components/buttons/buttons.js';
|
|
8
|
+
import * as UIHelpers from '../../ui/helpers/helpers.js';
|
|
8
9
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
9
10
|
import {html, render, type TemplateResult} from '../../ui/lit/lit.js';
|
|
10
11
|
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
@@ -108,7 +109,7 @@ export const DEFAULT_VIEW: View = (input, _output, target) => {
|
|
|
108
109
|
jslog=${VisualLogging.toggle('emulate-page-focus').track({change: true})} ${bindToSetting('emulate-page-focus')}>${
|
|
109
110
|
i18nString(UIStrings.emulateFocusedPage)}</devtools-checkbox>
|
|
110
111
|
<devtools-button
|
|
111
|
-
@click=${() =>
|
|
112
|
+
@click=${() => UIHelpers.openInNewTab('https://developer.chrome.com/docs/devtools/rendering/apply-effects#emulate_a_focused_page')}
|
|
112
113
|
.data=${{
|
|
113
114
|
variant: Buttons.Button.Variant.ICON,
|
|
114
115
|
iconName: 'help',
|
|
@@ -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 = 1;
|
|
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
|
};
|
|
@@ -49,6 +49,7 @@ import * as InlineEditor from '../../ui/legacy/components/inline_editor/inline_e
|
|
|
49
49
|
import * 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 * as ElementsComponents from './components/components.js';
|
|
54
55
|
import type {ComputedStyleModel, CSSModelChangedEvent} from './ComputedStyleModel.js';
|
|
@@ -58,8 +59,8 @@ import {ImagePreviewPopover} from './ImagePreviewPopover.js';
|
|
|
58
59
|
import * as LayersWidget from './LayersWidget.js';
|
|
59
60
|
import {StyleEditorWidget} from './StyleEditorWidget.js';
|
|
60
61
|
import {
|
|
62
|
+
AtRuleSection,
|
|
61
63
|
BlankStylePropertiesSection,
|
|
62
|
-
FontPaletteValuesRuleSection,
|
|
63
64
|
FunctionRuleSection,
|
|
64
65
|
HighlightPseudoStylePropertiesSection,
|
|
65
66
|
KeyframePropertiesSection,
|
|
@@ -139,6 +140,8 @@ const MIN_FOLDED_SECTIONS_COUNT = 5;
|
|
|
139
140
|
export const REGISTERED_PROPERTY_SECTION_NAME = '@property';
|
|
140
141
|
/** Title of the function section **/
|
|
141
142
|
export const FUNCTION_SECTION_NAME = '@function';
|
|
143
|
+
/** Title of the general at-rule section */
|
|
144
|
+
export const AT_RULE_SECTION_NAME = '@font-*';
|
|
142
145
|
|
|
143
146
|
// Highlightable properties are those that can be hovered in the sidebar to trigger a specific
|
|
144
147
|
// highlighting mode on the current element.
|
|
@@ -354,6 +357,10 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
|
|
|
354
357
|
this.jumpToSection(functionName, FUNCTION_SECTION_NAME);
|
|
355
358
|
}
|
|
356
359
|
|
|
360
|
+
jumpToFontPaletteDefinition(paletteName: string): void {
|
|
361
|
+
this.jumpToSection(`@font-palette-values ${paletteName}`, AT_RULE_SECTION_NAME);
|
|
362
|
+
}
|
|
363
|
+
|
|
357
364
|
forceUpdate(): void {
|
|
358
365
|
this.needsForceUpdate = true;
|
|
359
366
|
this.#swatchPopoverHelper.hide();
|
|
@@ -1153,14 +1160,16 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
|
|
|
1153
1160
|
blocks.push(block);
|
|
1154
1161
|
}
|
|
1155
1162
|
|
|
1156
|
-
const
|
|
1157
|
-
if (
|
|
1158
|
-
const
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1163
|
+
const atRules = matchedStyles.atRules();
|
|
1164
|
+
if (atRules.length > 0) {
|
|
1165
|
+
const expandedByDefault = atRules.length <= MIN_FOLDED_SECTIONS_COUNT;
|
|
1166
|
+
const block = SectionBlock.createAtRuleBlock(expandedByDefault);
|
|
1167
|
+
for (const atRule of atRules) {
|
|
1168
|
+
this.idleCallbackManager.schedule(() => {
|
|
1169
|
+
block.sections.push(new AtRuleSection(this, matchedStyles, atRule.style, sectionIdx, expandedByDefault));
|
|
1170
|
+
sectionIdx++;
|
|
1171
|
+
});
|
|
1172
|
+
}
|
|
1164
1173
|
blocks.push(block);
|
|
1165
1174
|
}
|
|
1166
1175
|
|
|
@@ -1543,7 +1552,7 @@ export class SectionBlock {
|
|
|
1543
1552
|
const pseudoArgumentString = pseudoArgument ? `(${pseudoArgument})` : '';
|
|
1544
1553
|
const pseudoTypeString = `${pseudoType}${pseudoArgumentString}`;
|
|
1545
1554
|
UI.UIUtils.createTextChild(separatorElement, i18nString(UIStrings.inheritedFromSPseudoOf, {PH1: pseudoTypeString}));
|
|
1546
|
-
const link =
|
|
1555
|
+
const link = PanelsCommon.DOMLinkifier.Linkifier.instance().linkify(node, {
|
|
1547
1556
|
preventKeyboardFocus: true,
|
|
1548
1557
|
tooltip: undefined,
|
|
1549
1558
|
});
|
|
@@ -1575,11 +1584,12 @@ export class SectionBlock {
|
|
|
1575
1584
|
return new SectionBlock(separatorElement);
|
|
1576
1585
|
}
|
|
1577
1586
|
|
|
1578
|
-
static
|
|
1587
|
+
static createAtRuleBlock(expandedByDefault: boolean): SectionBlock {
|
|
1579
1588
|
const separatorElement = document.createElement('div');
|
|
1589
|
+
const block = new SectionBlock(separatorElement, true, expandedByDefault);
|
|
1580
1590
|
separatorElement.className = 'sidebar-separator';
|
|
1581
|
-
separatorElement.
|
|
1582
|
-
return
|
|
1591
|
+
separatorElement.appendChild(document.createTextNode(AT_RULE_SECTION_NAME));
|
|
1592
|
+
return block;
|
|
1583
1593
|
}
|
|
1584
1594
|
|
|
1585
1595
|
static createPositionTryBlock(positionTryName: string): SectionBlock {
|
|
@@ -1595,7 +1605,7 @@ export class SectionBlock {
|
|
|
1595
1605
|
separatorElement.className = 'sidebar-separator';
|
|
1596
1606
|
separatorElement.setAttribute('jslog', `${VisualLogging.sectionHeader('inherited')}`);
|
|
1597
1607
|
UI.UIUtils.createTextChild(separatorElement, i18nString(UIStrings.inheritedFroms));
|
|
1598
|
-
const link =
|
|
1608
|
+
const link = PanelsCommon.DOMLinkifier.Linkifier.instance().linkify(node, {
|
|
1599
1609
|
preventKeyboardFocus: true,
|
|
1600
1610
|
tooltip: undefined,
|
|
1601
1611
|
});
|
|
@@ -689,16 +689,3 @@ UI.UIUtils.registerRenderer({
|
|
|
689
689
|
return Elements.ElementsTreeOutlineRenderer.Renderer.instance();
|
|
690
690
|
},
|
|
691
691
|
});
|
|
692
|
-
|
|
693
|
-
Common.Linkifier.registerLinkifier({
|
|
694
|
-
contextTypes() {
|
|
695
|
-
return [
|
|
696
|
-
SDK.DOMModel.DOMNode,
|
|
697
|
-
SDK.DOMModel.DeferredDOMNode,
|
|
698
|
-
];
|
|
699
|
-
},
|
|
700
|
-
async loadLinkifier() {
|
|
701
|
-
const Elements = await loadElementsModule();
|
|
702
|
-
return Elements.DOMLinkifier.Linkifier.instance();
|
|
703
|
-
},
|
|
704
|
-
});
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
import './InspectElementModeController.js';
|
|
6
6
|
import './ColorSwatchPopoverIcon.js';
|
|
7
7
|
import './ComputedStyleModel.js';
|
|
8
|
-
import './DOMLinkifier.js';
|
|
9
8
|
import './DOMPath.js';
|
|
10
9
|
import './ElementsSidebarPane.js';
|
|
11
10
|
import './ElementsTreeElement.js';
|
|
@@ -37,7 +36,6 @@ import * as ComputedStyleModel from './ComputedStyleModel.js';
|
|
|
37
36
|
import * as ComputedStyleWidget from './ComputedStyleWidget.js';
|
|
38
37
|
import * as CSSRuleValidator from './CSSRuleValidator.js';
|
|
39
38
|
import * as CSSValueTraceView from './CSSValueTraceView.js';
|
|
40
|
-
import * as DOMLinkifier from './DOMLinkifier.js';
|
|
41
39
|
import * as DOMPath from './DOMPath.js';
|
|
42
40
|
import * as ElementsPanel from './ElementsPanel.js';
|
|
43
41
|
import * as ElementsSidebarPane from './ElementsSidebarPane.js';
|
|
@@ -73,7 +71,6 @@ export {
|
|
|
73
71
|
ComputedStyleWidget,
|
|
74
72
|
CSSRuleValidator,
|
|
75
73
|
CSSValueTraceView,
|
|
76
|
-
DOMLinkifier,
|
|
77
74
|
DOMPath,
|
|
78
75
|
ElementsPanel,
|
|
79
76
|
ElementsSidebarPane,
|