chrome-devtools-frontend 1.0.1726686 → 1.0.1730971
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/.agents/rules/tests/test-strict-assertions-and-literal-expectations.md +1 -1
- package/.agents/rules/tests/test-view-and-presenter-isolation.md +1 -1
- package/.agents/rules/ui-and-widgets/ui-accessibility-and-semantic-html.md +1 -1
- package/.agents/rules/ui-and-widgets/ui-css-scoping-and-flex-layout.md +2 -2
- package/.agents/rules/ui-and-widgets/ui-declarative-child-widget-composition.md +5 -5
- package/.agents/rules/ui-and-widgets/ui-lit-declarative-templates-and-directives.md +2 -2
- package/.agents/rules/ui-and-widgets/ui-localization-and-uistrings-hygiene.md +2 -2
- package/.agents/rules/ui-and-widgets/ui-modern-component-and-encapsulation-standards.md +3 -3
- package/.agents/rules/ui-and-widgets/ui-pure-view-and-presenter-separation.md +2 -2
- package/.agents/rules/ui-and-widgets/ui-reactive-widget-update-lifecycle.md +2 -2
- package/.agents/rules/ui-and-widgets/ui-view-output-and-callback-contracts.md +2 -2
- package/.agents/rules/ui-and-widgets/ui-widget-dom-and-listener-lifecycle.md +2 -2
- package/.agents/skills/code-review/SKILL.md +63 -12
- package/.agents/skills/ui-eng-vision-local-lit-renderer/SKILL.md +38 -10
- package/.agents/skills/ui-eng-vision-widget-promoter/SKILL.md +1 -0
- package/.agents/skills/ui-widgets/SKILL.md +8 -2
- package/.agents/skills/write-ai-eval-test/SKILL.md +106 -0
- package/AUTHORS +2 -0
- package/DIR_METADATA +1 -2
- package/README.md +48 -26
- package/config/typescript/tsconfig.base.json +1 -0
- package/config/typescript/tsconfig.eslint.json +1 -0
- package/docs/contributing/changes.md +25 -0
- package/docs/ui_engineering.md +13 -4
- package/eslint.config.mjs +323 -41
- package/front_end/core/common/Color.ts +7 -7
- package/front_end/core/common/ParsedURL.ts +3 -3
- package/front_end/core/common/ResolverBase.ts +3 -3
- package/front_end/core/common/SegmentedRange.ts +3 -3
- package/front_end/core/common/SimpleHistoryManager.ts +14 -14
- package/front_end/core/common/Trie.ts +3 -3
- package/front_end/core/common/VersionController.ts +7 -7
- package/front_end/core/host/InspectorFrontendHost.ts +2 -2
- package/front_end/core/host/InspectorFrontendHostAPI.ts +9 -1
- package/front_end/core/host/InspectorFrontendHostStub.ts +1 -1
- package/front_end/core/host/UserMetrics.ts +4 -0
- package/front_end/core/host/UserMetricsEnums.ts +2 -1
- package/front_end/core/platform/StringUtilities.ts +54 -13
- package/front_end/core/platform/node/HostRuntime.ts +13 -7
- package/front_end/core/protocol_client/DevToolsCDPConnection.ts +4 -5
- package/front_end/core/root/Runtime.ts +5 -0
- package/front_end/core/sdk/AccessibilityModel.ts +5 -5
- package/front_end/core/sdk/AnimationModel.ts +17 -19
- package/front_end/core/sdk/CPUProfilerModel.ts +3 -3
- package/front_end/core/sdk/CPUThrottlingManager.ts +7 -0
- package/front_end/core/sdk/CSSMatchedStyles.ts +73 -13
- package/front_end/core/sdk/CSSMetadata.ts +7 -7
- package/front_end/core/sdk/CSSModel.ts +33 -33
- package/front_end/core/sdk/CSSProperty.ts +5 -5
- package/front_end/core/sdk/CSSRule.ts +6 -6
- package/front_end/core/sdk/CSSStyleSheetHeader.ts +4 -4
- package/front_end/core/sdk/Connections.ts +16 -16
- package/front_end/core/sdk/ConsoleModel.ts +44 -47
- package/front_end/core/sdk/CookieParser.ts +11 -11
- package/front_end/core/sdk/EmulationModel.ts +35 -36
- package/front_end/core/sdk/EventBreakpointsModel.ts +11 -11
- package/front_end/core/sdk/FrameManager.ts +16 -16
- package/front_end/core/sdk/IsolateManager.ts +2 -2
- package/front_end/core/sdk/IssuesModel.ts +2 -2
- package/front_end/core/sdk/OverlayModel.ts +19 -19
- package/front_end/core/sdk/PageResourceLoader.ts +14 -16
- package/front_end/core/sdk/RemoteObject.ts +9 -9
- package/front_end/core/sdk/Resource.ts +2 -2
- package/front_end/core/sdk/RuntimeModel.ts +7 -7
- package/front_end/core/sdk/Script.ts +6 -6
- package/front_end/core/sdk/ServiceWorkerManager.ts +36 -10
- package/front_end/core/sdk/SourceMap.ts +18 -20
- package/front_end/core/sdk/SourceMapManager.ts +2 -2
- package/front_end/core/sdk/TargetManager.ts +2 -2
- package/front_end/devtools_compatibility.js +7 -3
- package/front_end/entrypoints/inspector_main/InspectorMain.ts +2 -2
- package/front_end/entrypoints/node_app/app/NodeConnectionsPanel.ts +203 -115
- package/front_end/generated/InspectorBackendCommands.ts +1 -1
- package/front_end/generated/SupportedCSSProperties.ts +1 -3
- package/front_end/generated/protocol.ts +1 -0
- package/front_end/models/ai_assistance/AiAgent2.ts +36 -12
- package/front_end/models/ai_assistance/AiConversation.ts +8 -2
- package/front_end/models/ai_assistance/agents/AiAgent.ts +137 -62
- package/front_end/models/ai_assistance/agents/ExecuteJavascript.ts +2 -2
- package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +2 -2
- package/front_end/models/ai_assistance/data_formatters/LighthouseFormatter.snapshot.txt +149 -2
- package/front_end/models/ai_assistance/data_formatters/LighthouseFormatter.ts +269 -42
- package/front_end/models/ai_assistance/tools/ExecuteJavaScript.ts +3 -0
- package/front_end/models/ai_assistance/tools/GetLighthouseAudits.ts +9 -0
- package/front_end/models/ai_assistance/tools/ResolveDevtoolsNodePath.ts +13 -2
- package/front_end/models/ai_assistance/tools/RunLighthouse.ts +23 -7
- package/front_end/models/ai_assistance/tools/Tool.ts +7 -5
- package/front_end/models/bindings/CSSWorkspaceBinding.ts +22 -24
- package/front_end/models/bindings/DebuggerLanguagePlugins.ts +60 -60
- package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +24 -24
- package/front_end/models/bindings/DefaultScriptMapping.ts +8 -8
- package/front_end/models/bindings/FileUtils.ts +13 -13
- package/front_end/models/bindings/PresentationConsoleMessageHelper.ts +3 -3
- package/front_end/models/bindings/ResourceScriptMapping.ts +23 -23
- package/front_end/models/comment_manager/CommentManager.ts +3 -3
- package/front_end/models/comment_manager/CommentThread.ts +50 -5
- package/front_end/models/cpu_profile/CPUProfileDataModel.ts +14 -14
- package/front_end/models/cpu_profile/ProfileTreeModel.ts +4 -4
- package/front_end/models/elements/StyleChanges.ts +38 -0
- package/front_end/models/emulation/EmulatedDevices.ts +12 -12
- package/front_end/models/har/HARFormat.ts +4 -4
- package/front_end/models/javascript_metadata/NativeFunctions.ts +5 -1
- package/front_end/models/lighthouse/LighthouseReporterTypes.ts +57 -3
- package/front_end/models/lighthouse/RunTypes.ts +9 -1
- package/front_end/models/logs/LogManager.ts +2 -2
- package/front_end/models/persistence/AutomaticFileSystemManager.ts +3 -0
- package/front_end/models/persistence/FileSystemWorkspaceBinding.ts +24 -24
- package/front_end/models/persistence/IsolatedFileSystemManager.ts +6 -0
- package/front_end/models/persistence/NetworkPersistenceManager.ts +8 -3
- package/front_end/models/trace/LanternComputationData.ts +37 -11
- package/front_end/models/trace/Processor.ts +2 -1
- package/front_end/models/trace/extras/TraceTree.ts +36 -10
- package/front_end/models/trace/handlers/InitiatorsHandler.ts +27 -34
- package/front_end/models/trace/handlers/LayoutShiftsHandler.ts +2 -6
- package/front_end/models/trace/handlers/SamplesHandler.ts +9 -6
- package/front_end/models/workspace/FileManager.ts +6 -0
- package/front_end/panels/accessibility/ARIAAttributesView.ts +4 -4
- package/front_end/panels/accessibility/AccessibilityAnnouncementRecordingView.ts +8 -1
- package/front_end/panels/accessibility/AccessibilityNodeView.ts +15 -17
- package/front_end/panels/accessibility/AccessibilitySubPane.ts +1 -1
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +5 -5
- package/front_end/panels/ai_assistance/ExternalHandler.ts +10 -1
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +27 -22
- package/front_end/panels/ai_assistance/components/DisabledWidget.ts +19 -23
- package/front_end/panels/ai_assistance/components/ExploreWidget.ts +2 -2
- package/front_end/panels/ai_assistance/components/PermissionPrompt.ts +23 -9
- package/front_end/panels/ai_assistance/components/chatInput.css +1 -1
- package/front_end/panels/animation/AnimationTimeline.ts +37 -17
- package/front_end/panels/animation/animationTimeline.css +19 -3
- package/front_end/panels/application/AppManifestView.ts +1 -2
- package/front_end/panels/application/ApplicationPanelSidebar.ts +143 -128
- package/front_end/panels/application/DOMStorageItemsView.ts +14 -14
- package/front_end/panels/application/DeviceBoundSessionsView.ts +10 -13
- package/front_end/panels/application/ExtensionStorageItemsView.ts +3 -4
- package/front_end/panels/application/IndexedDBViews.ts +8 -4
- package/front_end/panels/application/KeyValueStorageItemsView.ts +4 -5
- package/front_end/panels/application/PrivateVerificationTokensView.ts +53 -0
- package/front_end/panels/application/ServiceWorkerCacheViews.ts +12 -8
- package/front_end/panels/application/ServiceWorkersView.ts +1 -2
- package/front_end/panels/application/StorageItemsToolbar.ts +3 -3
- package/front_end/panels/application/StorageView.ts +2 -2
- package/front_end/panels/application/WebMCPView.ts +91 -109
- package/front_end/panels/application/application.ts +2 -0
- package/front_end/panels/application/components/StorageMetadataView.ts +6 -6
- package/front_end/panels/application/preloading/PreloadingView.ts +70 -37
- package/front_end/panels/application/preloading/components/MismatchedPreloadingGrid.ts +2 -2
- package/front_end/panels/application/preloading/components/PreloadingDisabledInfobar.ts +3 -3
- package/front_end/panels/application/preloading/components/PreloadingGrid.ts +12 -0
- package/front_end/panels/application/preloading/components/RuleSetDetailsView.ts +10 -11
- package/front_end/panels/application/privateVerificationTokensView.css +20 -0
- package/front_end/panels/application/serviceWorkersView.css +2 -2
- package/front_end/panels/browser_debugger/DOMBreakpointsSidebarPane.ts +24 -24
- package/front_end/panels/changes/ChangesSidebar.ts +5 -5
- package/front_end/panels/changes/ChangesView.ts +10 -11
- package/front_end/panels/comments/CommentsPane.ts +292 -102
- package/front_end/panels/comments/commentsPane.css +93 -12
- package/front_end/panels/common/CommentThreadWidget.ts +69 -0
- package/front_end/panels/common/CommentsOverlayWidget.ts +108 -29
- package/front_end/panels/common/CommentsStatusBarPill.ts +17 -6
- package/front_end/panels/common/DOMLinkifier.ts +37 -12
- package/front_end/panels/common/ExtensionPanel.ts +13 -4
- package/front_end/panels/common/ExtensionServer.ts +27 -3
- package/front_end/panels/common/PersistenceUtils.ts +3 -3
- package/front_end/panels/common/commentThreadWidget.css +25 -1
- package/front_end/panels/common/common-meta.ts +10 -0
- package/front_end/panels/console/ConsolePinPane.ts +13 -15
- package/front_end/panels/console/ConsolePrompt.ts +173 -95
- package/front_end/panels/console/ConsoleSidebar.ts +2 -2
- package/front_end/panels/console/ConsoleView.ts +75 -79
- package/front_end/panels/console/ConsoleViewMessage.ts +52 -4
- package/front_end/panels/console/SymbolizedErrorWidget.ts +8 -4
- package/front_end/panels/console/consolePrompt.css +1 -1
- package/front_end/panels/console/consoleView.css +1 -1
- package/front_end/panels/console_counters/WarningErrorCounter.ts +3 -4
- package/front_end/panels/coverage/CoverageListView.ts +2 -2
- package/front_end/panels/coverage/CoverageView.ts +20 -5
- package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +4 -3
- package/front_end/panels/css_overview/CSSOverviewPanel.ts +2 -2
- package/front_end/panels/css_overview/CSSOverviewProcessingView.ts +2 -2
- package/front_end/panels/css_overview/CSSOverviewSidebarPanel.ts +2 -2
- package/front_end/panels/css_overview/CSSOverviewStartView.ts +2 -2
- package/front_end/panels/css_overview/CSSOverviewUnusedDeclarations.ts +8 -8
- package/front_end/panels/developer_resources/DeveloperResourcesListView.ts +2 -3
- package/front_end/panels/developer_resources/DeveloperResourcesView.ts +4 -5
- package/front_end/panels/elements/AccessibilityTreeUtils.ts +6 -7
- package/front_end/panels/elements/CSSValueTraceView.ts +3 -3
- package/front_end/panels/elements/ClassesPaneWidget.ts +1 -2
- package/front_end/panels/elements/ComputedStyleWidget.ts +15 -14
- package/front_end/panels/elements/DOMTreeElementWidget.ts +5 -4
- package/front_end/panels/elements/DOMTreeWidget.ts +2 -1
- package/front_end/panels/elements/ElementStatePaneWidget.ts +2 -2
- package/front_end/panels/elements/ElementsPanel.ts +1 -0
- package/front_end/panels/elements/EventListenersWidget.ts +2 -2
- package/front_end/panels/elements/LayoutPane.ts +2 -2
- package/front_end/panels/elements/PlatformFontsWidget.ts +3 -3
- package/front_end/panels/elements/PropertiesWidget.ts +9 -10
- package/front_end/panels/elements/PropertyRenderer.ts +72 -11
- package/front_end/panels/elements/StandaloneStylesContainer.ts +5 -10
- package/front_end/panels/elements/StyleEditorWidget.ts +30 -16
- package/front_end/panels/elements/StylePropertiesSection.ts +93 -44
- package/front_end/panels/elements/StylePropertyTreeElement.ts +230 -302
- package/front_end/panels/elements/StylesContainer.ts +2 -3
- package/front_end/panels/elements/StylesSidebarPane.ts +4 -13
- package/front_end/panels/elements/components/AccessibilityTreeNode.ts +66 -37
- package/front_end/panels/elements/components/CSSHintDetailsView.ts +51 -41
- package/front_end/panels/elements/components/CSSPropertyDocsView.ts +75 -65
- package/front_end/panels/elements/components/CSSQuery.ts +112 -74
- package/front_end/panels/elements/components/CSSVariableValueView.ts +109 -68
- package/front_end/panels/elements/components/ComputedStyleProperty.ts +64 -45
- package/front_end/panels/elements/components/ElementsTreeExpandButton.ts +35 -28
- package/front_end/panels/elements/components/QueryContainer.ts +104 -74
- package/front_end/panels/elements/components/accessibilityTreeNode.css +22 -20
- package/front_end/panels/elements/components/computedStyleProperty.css +2 -0
- package/front_end/panels/elements/components/cssHintDetailsView.css +23 -21
- package/front_end/panels/elements/components/cssPropertyDocsView.css +38 -36
- package/front_end/panels/elements/components/cssVariableValueView.css +42 -40
- package/front_end/panels/elements/components/elementsTreeExpandButton.css +5 -2
- package/front_end/panels/elements/components/queryContainer.css +23 -21
- package/front_end/panels/elements/stylesSidebarPane.css +3 -3
- package/front_end/panels/emulation/DeviceModeToolbar.ts +2 -2
- package/front_end/panels/emulation/InspectedPagePlaceholder.ts +2 -2
- package/front_end/panels/emulation/MediaQueryInspector.ts +9 -10
- package/front_end/panels/emulation/mediaQueryInspector.css +1 -1
- package/front_end/panels/event_listeners/EventListenersView.ts +2 -2
- package/front_end/panels/issues/AffectedCookiesView.ts +144 -101
- package/front_end/panels/issues/AffectedDescendantsWithinSelectElementView.ts +83 -31
- package/front_end/panels/issues/AffectedDirectivesView.ts +218 -135
- package/front_end/panels/issues/AffectedDocumentsInQuirksModeView.ts +84 -34
- package/front_end/panels/issues/AffectedElementsView.ts +86 -23
- package/front_end/panels/issues/AffectedLazyLoadImagesView.ts +2 -2
- package/front_end/panels/issues/AffectedMetadataAllowedSitesView.ts +2 -2
- package/front_end/panels/issues/AffectedPartitioningBlobURLView.ts +36 -11
- package/front_end/panels/issues/AffectedSharedArrayBufferIssueDetailsView.ts +135 -58
- package/front_end/panels/issues/AffectedSourcesView.ts +49 -28
- package/front_end/panels/issues/AffectedTrackingSitesView.ts +3 -4
- package/front_end/panels/issues/CorsIssueDetailsView.ts +490 -269
- package/front_end/panels/issues/GenericIssueDetailsView.ts +2 -2
- package/front_end/panels/issues/IssueKindView.ts +63 -48
- package/front_end/panels/issues/IssueView.ts +14 -18
- package/front_end/panels/issues/components/ElementsPanelLink.ts +70 -34
- package/front_end/panels/issues/components/HideIssuesMenu.ts +56 -32
- package/front_end/panels/issues/components/elementsPanelLink.css +10 -6
- package/front_end/panels/issues/components/hideIssuesMenu.css +16 -14
- package/front_end/panels/issues/issues.ts +2 -0
- package/front_end/panels/issues/issuesTree.css +4 -4
- package/front_end/panels/lighthouse/LighthouseController.ts +6 -6
- package/front_end/panels/lighthouse/LighthouseStatusView.ts +12 -13
- package/front_end/panels/lighthouse/lighthouseStartView.css +1 -1
- package/front_end/panels/linear_memory_inspector/LinearMemoryInspectorPane.ts +159 -161
- package/front_end/panels/linear_memory_inspector/LinearMemoryInspectorView.ts +228 -0
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryInspector.ts +32 -41
- package/front_end/panels/linear_memory_inspector/components/linearMemoryHighlightChipList.css +2 -2
- package/front_end/panels/linear_memory_inspector/linear_memory_inspector.ts +2 -0
- package/front_end/panels/media/EventDisplayTable.ts +2 -2
- package/front_end/panels/media/MainView.ts +132 -66
- package/front_end/panels/media/PlayerDetailView.ts +32 -14
- package/front_end/panels/media/PlayerListView.ts +83 -23
- package/front_end/panels/media/PlayerPropertiesView.ts +2 -2
- package/front_end/panels/media/TickingFlameChart.ts +153 -63
- package/front_end/panels/mobile_throttling/NetworkThrottlingSelector.ts +2 -2
- package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +615 -464
- package/front_end/panels/mobile_throttling/throttlingSettingsTab.css +43 -0
- package/front_end/panels/network/EventSourceMessagesView.ts +3 -3
- package/front_end/panels/network/NetworkConfigView.ts +6 -2
- package/front_end/panels/network/NetworkDataGridNode.ts +2 -1
- package/front_end/panels/network/NetworkItemView.ts +27 -26
- package/front_end/panels/network/NetworkManageCustomHeadersView.ts +236 -97
- package/front_end/panels/network/NetworkOverview.ts +8 -10
- package/front_end/panels/network/RequestConditionsDrawer.ts +8 -4
- package/front_end/panels/network/RequestDeviceBoundSessionsView.ts +2 -4
- package/front_end/panels/network/RequestHTMLView.ts +26 -7
- package/front_end/panels/network/RequestHeadersView.ts +2 -2
- package/front_end/panels/network/RequestInitiatorView.ts +21 -22
- package/front_end/panels/network/RequestPayloadView.ts +2 -16
- package/front_end/panels/network/RequestPreviewView.ts +5 -5
- package/front_end/panels/network/RequestTimingView.ts +6 -6
- package/front_end/panels/network/ResourceDirectSocketChunkView.ts +5 -6
- package/front_end/panels/network/ResourceWebSocketFrameView.ts +4 -3
- package/front_end/panels/network/ShowMoreDetailsWidget.ts +11 -12
- package/front_end/panels/network/SignedExchangeInfoView.ts +2 -2
- package/front_end/panels/network/networkLogView.css +2 -2
- package/front_end/panels/network/networkManageCustomHeadersView.css +27 -6
- package/front_end/panels/network/requestConditionsDrawer.css +1 -1
- package/front_end/panels/network/requestInitiatorView.css +5 -3
- package/front_end/panels/performance_monitor/PerformanceMonitor.ts +2 -2
- package/front_end/panels/profiler/HeapDetachedElementsView.ts +1 -2
- package/front_end/panels/profiler/HeapTimelineOverview.ts +77 -15
- package/front_end/panels/profiler/IsolateSelector.ts +258 -187
- package/front_end/panels/profiler/ProfileLauncherView.ts +7 -29
- package/front_end/panels/profiler/profileLauncherView.css +6 -1
- package/front_end/panels/protocol_monitor/JSONEditor.ts +4 -5
- package/front_end/panels/recorder/ControlButton.ts +1 -1
- package/front_end/panels/recorder/RecordingListView.ts +2 -4
- package/front_end/panels/recorder/RecordingView.ts +1 -2
- package/front_end/panels/recorder/SelectorPicker.ts +2 -4
- package/front_end/panels/recorder/StepView.ts +24 -10
- package/front_end/panels/recorder/TimelineSection.ts +1 -1
- package/front_end/panels/recorder/recordingView.css +1 -1
- package/front_end/panels/screencast/ScreencastApp.ts +1 -1
- package/front_end/panels/search/SearchResultsPane.ts +11 -12
- package/front_end/panels/search/SearchView.ts +8 -10
- package/front_end/panels/security/SecurityPanel.ts +1 -8
- package/front_end/panels/security/SecurityPanelSidebar.ts +2 -2
- package/front_end/panels/security/mainView.css +1 -1
- package/front_end/panels/sensors/LocationsSettingsTab.ts +1 -2
- package/front_end/panels/settings/AISettingsTab.ts +1 -1
- package/front_end/panels/settings/BackendLinkingSettingsTab.ts +34 -20
- package/front_end/panels/settings/EditFileSystemView.ts +2 -2
- package/front_end/panels/settings/FrameworkIgnoreListSettingsTab.ts +375 -197
- package/front_end/panels/settings/KeybindsSettingsTab.ts +570 -414
- package/front_end/panels/settings/SettingsScreen.ts +312 -114
- package/front_end/panels/settings/WorkspaceSettingsTab.ts +2 -2
- package/front_end/panels/settings/aiSettingsTab.css +1 -4
- package/front_end/panels/settings/emulation/DevicesSettingsTab.ts +924 -578
- package/front_end/panels/settings/emulation/components/UserAgentClientHintsForm.ts +9 -2
- package/front_end/panels/settings/emulation/devicesSettingsTab.css +39 -0
- package/front_end/panels/settings/frameworkIgnoreListSettingsTab.css +37 -8
- package/front_end/panels/settings/settingsScreen.css +0 -24
- package/front_end/panels/sources/BreakpointEditDialog.ts +9 -6
- package/front_end/panels/sources/BreakpointsView.ts +25 -4
- package/front_end/panels/sources/CallStackSidebarPane.ts +7 -1
- package/front_end/panels/sources/DebuggerPlugin.ts +1 -0
- package/front_end/panels/sources/GoToLineQuickOpen.ts +8 -8
- package/front_end/panels/sources/NavigatorView.ts +521 -439
- package/front_end/panels/sources/PersistenceActions.ts +11 -12
- package/front_end/panels/sources/ProfilePlugin.ts +28 -17
- package/front_end/panels/sources/ScopeChainSidebarPane.ts +3 -4
- package/front_end/panels/sources/SourcesNavigator.ts +9 -9
- package/front_end/panels/sources/SourcesPanel.ts +2 -2
- package/front_end/panels/sources/SourcesView.ts +3 -3
- package/front_end/panels/sources/ThreadsSidebarPane.ts +2 -2
- package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +2 -2
- package/front_end/panels/sources/components/HeadersView.ts +1 -2
- package/front_end/panels/timeline/CompatibilityTracksAppender.ts +5 -6
- package/front_end/panels/timeline/EventsTimelineTreeView.ts +73 -34
- package/front_end/panels/timeline/IsolateSelector.ts +25 -37
- package/front_end/panels/timeline/StatusDialog.ts +5 -7
- package/front_end/panels/timeline/ThirdPartyTreeView.ts +10 -13
- package/front_end/panels/timeline/TimelineDetailsView.ts +40 -21
- package/front_end/panels/timeline/TimelineEventOverview.ts +130 -34
- package/front_end/panels/timeline/TimelineFlameChartNetworkDataProvider.ts +1 -1
- package/front_end/panels/timeline/TimelineMiniMap.ts +255 -103
- package/front_end/panels/timeline/TimelinePaintProfilerView.ts +19 -11
- package/front_end/panels/timeline/TimelinePanel.ts +1 -0
- package/front_end/panels/timeline/TimelineSelectorStatsView.ts +11 -12
- package/front_end/panels/timeline/TimelineTreeView.ts +240 -122
- package/front_end/panels/timeline/TimelineUIUtils.ts +12 -0
- package/front_end/panels/timeline/components/BreadcrumbsUI.ts +5 -4
- package/front_end/panels/timeline/components/DetailsView.ts +97 -65
- package/front_end/panels/timeline/components/LayoutShiftDetails.ts +2 -2
- package/front_end/panels/timeline/components/MetricCard.ts +2 -2
- package/front_end/panels/timeline/components/NetworkRequestDetails.ts +11 -12
- package/front_end/panels/timeline/components/NetworkTrackWidget.ts +57 -50
- package/front_end/panels/timeline/components/RelatedInsightChips.ts +2 -2
- package/front_end/panels/timeline/components/Sidebar.ts +161 -109
- package/front_end/panels/timeline/components/SidebarAnnotationsTab.ts +33 -12
- package/front_end/panels/timeline/components/SidebarInsightsTab.ts +3 -0
- package/front_end/panels/timeline/components/insights/LCPDiscovery.ts +11 -11
- package/front_end/panels/timeline/components/insights/SlowCSSSelector.ts +6 -7
- package/front_end/panels/timeline/components/networkTrackWidget.css +24 -22
- package/front_end/panels/timeline/components/sidebarInsightsTab.css +1 -1
- package/front_end/panels/timeline/overlays/components/TimespanBreakdownOverlay.ts +15 -10
- package/front_end/panels/timeline/overlays/components/entryLabelOverlay.css +1 -1
- package/front_end/panels/timeline/timelinePanel.css +5 -0
- package/front_end/panels/timeline/timelineStatusDialog.css +1 -1
- package/front_end/panels/web_audio/WebAudioView.ts +2 -2
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/legacy-javascript/README.chromium +2 -2
- package/front_end/third_party/legacy-javascript/lib/legacy-javascript.js +2 -2
- package/front_end/third_party/legacy-javascript/package.json +1 -1
- package/front_end/third_party/lighthouse/README.chromium +2 -2
- package/front_end/third_party/lighthouse/lighthouse-dt-bundle.js +1983 -2022
- package/front_end/third_party/lighthouse/locales/ar-XB.json +157 -142
- package/front_end/third_party/lighthouse/locales/ar.json +157 -142
- package/front_end/third_party/lighthouse/locales/bg.json +154 -139
- package/front_end/third_party/lighthouse/locales/ca.json +157 -142
- package/front_end/third_party/lighthouse/locales/cs.json +148 -133
- package/front_end/third_party/lighthouse/locales/da.json +153 -138
- package/front_end/third_party/lighthouse/locales/de.json +152 -137
- package/front_end/third_party/lighthouse/locales/el.json +153 -138
- package/front_end/third_party/lighthouse/locales/en-GB.json +160 -145
- package/front_end/third_party/lighthouse/locales/en-US.json +239 -218
- package/front_end/third_party/lighthouse/locales/en-XL.json +239 -218
- package/front_end/third_party/lighthouse/locales/es-419.json +150 -135
- package/front_end/third_party/lighthouse/locales/es.json +149 -134
- package/front_end/third_party/lighthouse/locales/fi.json +151 -136
- package/front_end/third_party/lighthouse/locales/fil.json +154 -139
- package/front_end/third_party/lighthouse/locales/fr.json +150 -135
- package/front_end/third_party/lighthouse/locales/he.json +160 -145
- package/front_end/third_party/lighthouse/locales/hi.json +156 -141
- package/front_end/third_party/lighthouse/locales/hr.json +154 -139
- package/front_end/third_party/lighthouse/locales/hu.json +111 -96
- package/front_end/third_party/lighthouse/locales/id.json +153 -138
- package/front_end/third_party/lighthouse/locales/it.json +153 -138
- package/front_end/third_party/lighthouse/locales/ja.json +150 -135
- package/front_end/third_party/lighthouse/locales/ko.json +42 -27
- package/front_end/third_party/lighthouse/locales/lt.json +152 -137
- package/front_end/third_party/lighthouse/locales/lv.json +93 -78
- package/front_end/third_party/lighthouse/locales/nl.json +149 -134
- package/front_end/third_party/lighthouse/locales/no.json +152 -137
- package/front_end/third_party/lighthouse/locales/pl.json +153 -138
- package/front_end/third_party/lighthouse/locales/pt-PT.json +152 -137
- package/front_end/third_party/lighthouse/locales/pt.json +157 -142
- package/front_end/third_party/lighthouse/locales/ro.json +149 -134
- package/front_end/third_party/lighthouse/locales/ru.json +76 -61
- package/front_end/third_party/lighthouse/locales/sk.json +153 -138
- package/front_end/third_party/lighthouse/locales/sl.json +149 -134
- package/front_end/third_party/lighthouse/locales/sr-Latn.json +151 -136
- package/front_end/third_party/lighthouse/locales/sr.json +151 -136
- package/front_end/third_party/lighthouse/locales/sv.json +152 -137
- package/front_end/third_party/lighthouse/locales/ta.json +156 -141
- package/front_end/third_party/lighthouse/locales/te.json +157 -142
- package/front_end/third_party/lighthouse/locales/th.json +111 -96
- package/front_end/third_party/lighthouse/locales/tr.json +153 -138
- package/front_end/third_party/lighthouse/locales/uk.json +149 -134
- package/front_end/third_party/lighthouse/locales/vi.json +162 -147
- package/front_end/third_party/lighthouse/locales/zh-HK.json +150 -135
- package/front_end/third_party/lighthouse/locales/zh-TW.json +154 -139
- package/front_end/third_party/lighthouse/locales/zh.json +152 -137
- package/front_end/third_party/lighthouse/report/bundle.d.ts +9 -8
- package/front_end/third_party/lighthouse/report/bundle.js +10 -10
- package/front_end/third_party/lighthouse/report-assets/report-generator.mjs +2 -7
- package/front_end/tsconfig.compatibility.json +1 -0
- package/front_end/tsconfig.json +3 -2
- package/front_end/ui/components/dialogs/TypeToAllowDialog.ts +0 -2
- package/front_end/ui/components/dialogs/typeToAllowDialog.css +0 -4
- package/front_end/ui/components/icon_button/fileSourceIcon.css +1 -1
- package/front_end/ui/components/input/textInput.css +1 -1
- package/front_end/ui/components/lists/List.ts +26 -14
- package/front_end/ui/components/menus/menus.ts +0 -2
- package/front_end/ui/components/suggestion_input/SuggestionInput.ts +351 -138
- package/front_end/ui/components/survey_link/surveyLink.css +3 -3
- package/front_end/ui/components/switch/switch.css +6 -6
- package/front_end/ui/components/text_editor/AiCodeCompletionTeaser.ts +2 -3
- package/front_end/ui/components/text_editor/TextEditor.ts +1 -1
- package/front_end/ui/components/tooltips/Tooltip.ts +53 -4
- package/front_end/ui/components/tree_outline/treeOutline.css +7 -7
- package/front_end/ui/helpers/OpenInNewTab.ts +8 -3
- package/front_end/ui/legacy/EmptyWidget.ts +4 -4
- package/front_end/ui/legacy/ForwardedInputEventHandler.ts +2 -2
- package/front_end/ui/legacy/GlassPane.ts +1 -1
- package/front_end/ui/legacy/KeyboardShortcut.ts +7 -7
- package/front_end/ui/legacy/RemoteDebuggingTerminatedScreen.ts +2 -2
- package/front_end/ui/legacy/TabbedPane.ts +198 -66
- package/front_end/ui/legacy/TargetCrashedScreen.ts +2 -2
- package/front_end/ui/legacy/UIUtils.ts +71 -68
- package/front_end/ui/legacy/View.ts +7 -4
- package/front_end/ui/legacy/ViewManager.ts +49 -37
- package/front_end/ui/legacy/Widget.ts +32 -12
- package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +2 -3
- package/front_end/ui/legacy/components/inline_editor/AnimationTimingUI.ts +8 -8
- package/front_end/ui/legacy/components/inline_editor/BezierUI.ts +8 -9
- package/front_end/ui/legacy/components/inline_editor/LinkSwatch.ts +2 -2
- package/front_end/ui/legacy/components/inline_editor/cssAngleEditor.css +1 -1
- package/front_end/ui/legacy/components/inline_editor/cssAngleSwatch.css +1 -1
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +45 -11
- package/front_end/ui/legacy/components/object_ui/RemoteObjectPreviewFormatter.ts +10 -12
- package/front_end/ui/legacy/components/perf_ui/ChartViewport.ts +102 -29
- package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +148 -122
- package/front_end/ui/legacy/components/perf_ui/TimelineOverviewPane.ts +20 -14
- package/front_end/ui/legacy/components/quick_open/filteredListWidget.css +1 -1
- package/front_end/ui/legacy/components/source_frame/FontView.ts +29 -5
- package/front_end/ui/legacy/components/source_frame/ImageView.ts +79 -12
- package/front_end/ui/legacy/components/source_frame/JSONView.ts +20 -2
- package/front_end/ui/legacy/components/source_frame/PreviewFactory.ts +2 -2
- package/front_end/ui/legacy/components/source_frame/StreamingContentHexView.ts +6 -10
- package/front_end/ui/legacy/components/source_frame/XMLView.ts +11 -11
- package/front_end/ui/legacy/components/source_frame/fontView.css +7 -0
- package/front_end/ui/legacy/components/source_frame/imageView.css +7 -0
- package/front_end/ui/legacy/components/utils/JSPresentationUtils.ts +14 -3
- package/front_end/ui/legacy/components/utils/Linkifier.ts +126 -2
- package/front_end/ui/legacy/emptyWidget.css +2 -1
- package/front_end/ui/legacy/inspectorCommon.css +3 -3
- package/front_end/ui/legacy/smallBubble.css +1 -1
- package/front_end/ui/legacy/tabbedPane.css +6 -0
- package/front_end/ui/lit/Directives.ts +35 -18
- package/front_end/ui/lit/lit.ts +0 -2
- package/front_end/ui/lit/render.ts +0 -7
- package/front_end/ui/visual_logging/KnownContextValues.ts +5 -0
- package/package.json +1 -1
- package/vpython.toml +8 -0
- package/vpython.toml.uv.lock +3 -0
- package/.agents/skills/review-models-core/SKILL.md +0 -73
- package/.agents/skills/review-tests/SKILL.md +0 -67
- package/.agents/skills/review-ui-widgets/SKILL.md +0 -115
- package/front_end/generated/ARIAProperties.ts +0 -2686
- package/front_end/ui/components/menus/README.md +0 -119
- package/front_end/ui/components/menus/SelectMenu.ts +0 -473
- package/front_end/ui/components/menus/selectMenu.css +0 -54
- package/front_end/ui/components/menus/selectMenuButton.css +0 -108
|
@@ -636,6 +636,7 @@ export class Linkifier extends Common.ObjectWrapper.ObjectWrapper<EventTypes> im
|
|
|
636
636
|
userMetric: options?.userMetric,
|
|
637
637
|
onRef: options.onRef,
|
|
638
638
|
allowPrivileged: options?.allowPrivileged,
|
|
639
|
+
initiatorId: options.initiatorId,
|
|
639
640
|
};
|
|
640
641
|
return Linkifier.renderLink(linkText, className, linkOptions);
|
|
641
642
|
}
|
|
@@ -707,6 +708,7 @@ export class Linkifier extends Common.ObjectWrapper.ObjectWrapper<EventTypes> im
|
|
|
707
708
|
columnNumber: options.columnNumber,
|
|
708
709
|
userMetric: options.userMetric,
|
|
709
710
|
allowPrivileged: options.allowPrivileged,
|
|
711
|
+
initiatorId: options.initiatorId,
|
|
710
712
|
};
|
|
711
713
|
infoByAnchor.set(link, linkInfo);
|
|
712
714
|
});
|
|
@@ -893,6 +895,25 @@ export class Linkifier extends Common.ObjectWrapper.ObjectWrapper<EventTypes> im
|
|
|
893
895
|
return Linkifier.linkInfo(link)?.uiLocation ?? null;
|
|
894
896
|
}
|
|
895
897
|
|
|
898
|
+
/**
|
|
899
|
+
* Returns the frame or worker to attribute opening `info`'s URL in a new tab to: the one it was linkified for,
|
|
900
|
+
* if given; the one that the network request it reveals belongs to; or the one that the source it points at
|
|
901
|
+
* was loaded by. A URL that merely matches some resource of the page is not attributed to that resource's
|
|
902
|
+
* frame: where the text came from matters, not what it happens to spell.
|
|
903
|
+
*/
|
|
904
|
+
private static initiatorIdForLink(info: LinkInfo): OpenInNewTabInitiatorId|undefined {
|
|
905
|
+
if (info.initiatorId) {
|
|
906
|
+
return typeof info.initiatorId === 'function' ? info.initiatorId() : info.initiatorId;
|
|
907
|
+
}
|
|
908
|
+
if (info.revealable instanceof SDK.NetworkRequest.NetworkRequest) {
|
|
909
|
+
return openInNewTabInitiatorId(info.revealable);
|
|
910
|
+
}
|
|
911
|
+
if (info.uiLocation) {
|
|
912
|
+
return openInNewTabInitiatorId(info.uiLocation.uiSourceCode);
|
|
913
|
+
}
|
|
914
|
+
return undefined;
|
|
915
|
+
}
|
|
916
|
+
|
|
896
917
|
static linkActions(info: LinkInfo): Array<{
|
|
897
918
|
section: string,
|
|
898
919
|
title: string,
|
|
@@ -973,7 +994,7 @@ export class Linkifier extends Common.ObjectWrapper.ObjectWrapper<EventTypes> im
|
|
|
973
994
|
section: 'reveal',
|
|
974
995
|
title: UI.UIUtils.openLinkExternallyLabel(),
|
|
975
996
|
jslogContext: 'open-in-new-tab',
|
|
976
|
-
handler: () => UIHelpers.openInNewTab(url, info.allowPrivileged),
|
|
997
|
+
handler: () => UIHelpers.openInNewTab(url, info.allowPrivileged, Linkifier.initiatorIdForLink(info)),
|
|
977
998
|
});
|
|
978
999
|
}
|
|
979
1000
|
result.push({
|
|
@@ -1127,7 +1148,8 @@ export class ContentProviderContextMenuProvider implements
|
|
|
1127
1148
|
() =>
|
|
1128
1149
|
UIHelpers.openInNewTab(contentUrl.endsWith(':formatted') ?
|
|
1129
1150
|
Common.ParsedURL.ParsedURL.slice(contentUrl, 0, contentUrl.lastIndexOf(':')) :
|
|
1130
|
-
contentUrl
|
|
1151
|
+
contentUrl,
|
|
1152
|
+
/* allowPrivileged= */ false, openInNewTabInitiatorId(contentProvider)),
|
|
1131
1153
|
{jslogContext: 'open-in-new-tab'});
|
|
1132
1154
|
}
|
|
1133
1155
|
for (const origin of linkHandlers.keys()) {
|
|
@@ -1164,6 +1186,88 @@ export class ContentProviderContextMenuProvider implements
|
|
|
1164
1186
|
}
|
|
1165
1187
|
}
|
|
1166
1188
|
|
|
1189
|
+
/**
|
|
1190
|
+
* Returns the {@link OpenInNewTabInitiatorId} for a URL that came from `source`: the frame that `source` belongs
|
|
1191
|
+
* to, or the worker that it belongs to when there is no frame, if DevTools knows that unambiguously. Returns
|
|
1192
|
+
* `undefined` otherwise, in which case the browser attributes the navigation to an opaque origin. A request,
|
|
1193
|
+
* resource or execution context is not attributed to its frame once the frame has navigated away from the
|
|
1194
|
+
* document it belongs to, or once the target that `source` came from no longer tracks the frame (see
|
|
1195
|
+
* {@link frameIdUnlessNavigatedSince}).
|
|
1196
|
+
*/
|
|
1197
|
+
export function openInNewTabInitiatorId(source: SDK.NetworkRequest.NetworkRequest|SDK.Resource.Resource|
|
|
1198
|
+
SDK.RuntimeModel.ExecutionContext|
|
|
1199
|
+
Workspace.UISourceCode.UISourceCode): OpenInNewTabInitiatorId|undefined {
|
|
1200
|
+
if (source instanceof SDK.NetworkRequest.NetworkRequest) {
|
|
1201
|
+
if (source.frameId) {
|
|
1202
|
+
return frameIdUnlessNavigatedSince(source.frameId, source.loaderId,
|
|
1203
|
+
SDK.ResourceTreeModel.ResourceTreeModel.frameForRequest(source));
|
|
1204
|
+
}
|
|
1205
|
+
return workerTargetId(SDK.NetworkManager.NetworkManager.forRequest(source)?.target());
|
|
1206
|
+
}
|
|
1207
|
+
if (source instanceof SDK.Resource.Resource) {
|
|
1208
|
+
return source.frameId ? frameIdUnlessNavigatedSince(source.frameId, source.loaderId, source.frame()) : undefined;
|
|
1209
|
+
}
|
|
1210
|
+
if (source instanceof SDK.RuntimeModel.ExecutionContext) {
|
|
1211
|
+
if (source.target().isDisposed()) {
|
|
1212
|
+
// No context events are dispatched for a target that is detached, e.g. because its frame navigated into
|
|
1213
|
+
// another process, so the context lingering in its model does not mean that its document is still there.
|
|
1214
|
+
return undefined;
|
|
1215
|
+
}
|
|
1216
|
+
return source.frameId ?? workerTargetId(source.target());
|
|
1217
|
+
}
|
|
1218
|
+
if (source instanceof Workspace.UISourceCode.UISourceCode) {
|
|
1219
|
+
const frames = Bindings.NetworkProject.NetworkProject.framesForUISourceCode(source);
|
|
1220
|
+
if (frames.length === 1) {
|
|
1221
|
+
return frames[0].id;
|
|
1222
|
+
}
|
|
1223
|
+
if (frames.length > 1) {
|
|
1224
|
+
// Loaded by several frames, which may not all be same-origin; whichever of them the link was created for
|
|
1225
|
+
// is unknown by now.
|
|
1226
|
+
return undefined;
|
|
1227
|
+
}
|
|
1228
|
+
return workerTargetId(Bindings.NetworkProject.NetworkProject.targetForUISourceCode(source));
|
|
1229
|
+
}
|
|
1230
|
+
return undefined;
|
|
1231
|
+
}
|
|
1232
|
+
|
|
1233
|
+
/**
|
|
1234
|
+
* Returns `frameId` unless `frame`, the frame with that id as the target that the request or resource came from
|
|
1235
|
+
* knows it, has navigated since the document identified by `loaderId` was in it. A frame keeps its id across
|
|
1236
|
+
* navigations, so a request or resource of a previous document must not be attributed to the document that the
|
|
1237
|
+
* frame shows now. A frame that navigates into another process moves to another target, which its old target
|
|
1238
|
+
* only learns of by the frame being detached (`frame` is `null`) or by being disposed itself (still knowing the
|
|
1239
|
+
* frame as it was): either way, the frame no longer shows the document.
|
|
1240
|
+
*/
|
|
1241
|
+
function frameIdUnlessNavigatedSince(frameId: Protocol.Page.FrameId, loaderId: Protocol.Network.LoaderId|null,
|
|
1242
|
+
frame: SDK.ResourceTreeModel.ResourceTreeFrame|null): Protocol.Page.FrameId|
|
|
1243
|
+
undefined {
|
|
1244
|
+
if (!frame || frame.resourceTreeModel().target().isDisposed() || (loaderId && frame.loaderId !== loaderId)) {
|
|
1245
|
+
return undefined;
|
|
1246
|
+
}
|
|
1247
|
+
return frameId;
|
|
1248
|
+
}
|
|
1249
|
+
|
|
1250
|
+
/**
|
|
1251
|
+
* Returns the id of `target` if it is a worker (or worklet), which has an origin but no frame. A frame target is
|
|
1252
|
+
* never used as a fallback: its id stands for its main frame, which may not be where a URL came from.
|
|
1253
|
+
*/
|
|
1254
|
+
function workerTargetId(target: SDK.Target.Target|null|undefined): Protocol.Target.TargetID|undefined {
|
|
1255
|
+
switch (target?.type()) {
|
|
1256
|
+
case SDK.Target.Type.Worker:
|
|
1257
|
+
case SDK.Target.Type.SHARED_WORKER:
|
|
1258
|
+
case SDK.Target.Type.ServiceWorker:
|
|
1259
|
+
case SDK.Target.Type.WORKLET:
|
|
1260
|
+
case SDK.Target.Type.AUCTION_WORKLET: {
|
|
1261
|
+
const id = target.id();
|
|
1262
|
+
// 'main' is the frontend's placeholder for a root target that it did not learn the id of; the browser does
|
|
1263
|
+
// not know it by that name.
|
|
1264
|
+
return id === 'main' ? undefined : id;
|
|
1265
|
+
}
|
|
1266
|
+
default:
|
|
1267
|
+
return undefined;
|
|
1268
|
+
}
|
|
1269
|
+
}
|
|
1270
|
+
|
|
1167
1271
|
interface LinkInfo {
|
|
1168
1272
|
enableDecorator?: boolean;
|
|
1169
1273
|
uiLocation?: Workspace.UISourceCode.UILocation;
|
|
@@ -1174,10 +1278,29 @@ interface LinkInfo {
|
|
|
1174
1278
|
fallback?: Element;
|
|
1175
1279
|
userMetric?: Host.UserMetrics.Action;
|
|
1176
1280
|
allowPrivileged?: boolean;
|
|
1281
|
+
initiatorId?: OpenInNewTabInitiatorIdOrProvider;
|
|
1177
1282
|
}
|
|
1178
1283
|
|
|
1284
|
+
/**
|
|
1285
|
+
* The DevTools frame id or target id of the frame or worker that a linkified URL came from. When the URL is opened
|
|
1286
|
+
* in a new tab, the browser attributes the navigation to it, like a link clicked in that frame or worker; see
|
|
1287
|
+
* `InspectorFrontendHostAPI.openInNewTab()`.
|
|
1288
|
+
*/
|
|
1289
|
+
export type OpenInNewTabInitiatorId = Protocol.Page.FrameId|Protocol.Target.TargetID;
|
|
1290
|
+
|
|
1291
|
+
/**
|
|
1292
|
+
* An {@link OpenInNewTabInitiatorId}, or a function that determines it at the time the link is opened. Use the
|
|
1293
|
+
* function when where the link came from may be gone by then: a frame keeps its id across navigations, so the id
|
|
1294
|
+
* of a frame that has since navigated would attribute the navigation to whatever document the frame shows now.
|
|
1295
|
+
*/
|
|
1296
|
+
export type OpenInNewTabInitiatorIdOrProvider = OpenInNewTabInitiatorId|(() => OpenInNewTabInitiatorId|undefined);
|
|
1297
|
+
|
|
1179
1298
|
export interface LinkifyURLOptions {
|
|
1180
1299
|
allowPrivileged?: boolean;
|
|
1300
|
+
/**
|
|
1301
|
+
* {@link OpenInNewTabInitiatorIdOrProvider}
|
|
1302
|
+
*/
|
|
1303
|
+
initiatorId?: OpenInNewTabInitiatorIdOrProvider;
|
|
1181
1304
|
text?: string;
|
|
1182
1305
|
className?: string;
|
|
1183
1306
|
lineNumber?: number;
|
|
@@ -1225,6 +1348,7 @@ interface CreateLinkOptions {
|
|
|
1225
1348
|
userMetric?: Host.UserMetrics.Action;
|
|
1226
1349
|
onRef?: (el: HTMLElement) => void;
|
|
1227
1350
|
allowPrivileged?: boolean;
|
|
1351
|
+
initiatorId?: OpenInNewTabInitiatorIdOrProvider;
|
|
1228
1352
|
}
|
|
1229
1353
|
|
|
1230
1354
|
interface LinkDisplayOptions {
|
|
@@ -306,7 +306,7 @@ input[type='range']::-webkit-slider-thumb,
|
|
|
306
306
|
width: var(--sys-size-6);
|
|
307
307
|
height: var(--sys-size-6);
|
|
308
308
|
margin-top: -5px;
|
|
309
|
-
border-radius:
|
|
309
|
+
border-radius: var(--sys-shape-corner-full);
|
|
310
310
|
background-color: var(--sys-color-primary);
|
|
311
311
|
}
|
|
312
312
|
|
|
@@ -522,7 +522,7 @@ dt-icon-label {
|
|
|
522
522
|
content: var(--image-file-empty);
|
|
523
523
|
width: var(--sys-size-4);
|
|
524
524
|
height: var(--sys-size-4);
|
|
525
|
-
border-radius:
|
|
525
|
+
border-radius: var(--sys-shape-corner-full);
|
|
526
526
|
outline: var(--sys-size-1) solid var(--icon-gap-default);
|
|
527
527
|
left: 9px;
|
|
528
528
|
position: absolute;
|
|
@@ -919,7 +919,7 @@ devtools-toolbar {
|
|
|
919
919
|
height: 4.5px;
|
|
920
920
|
border: var(--sys-size-2) solid
|
|
921
921
|
var(--override-toolbar-background-color, --sys-color-cdt-base-container);
|
|
922
|
-
border-radius:
|
|
922
|
+
border-radius: var(--sys-shape-corner-full);
|
|
923
923
|
right: 0;
|
|
924
924
|
}
|
|
925
925
|
|
|
@@ -20,7 +20,7 @@ div {
|
|
|
20
20
|
* We need an "inverted" color here - because the text is on a darker background the regular foreground text colors don't work. It's been logged to the dark mode tracking spreadsheet
|
|
21
21
|
*/
|
|
22
22
|
color: var(--sys-color-inverse-on-surface);
|
|
23
|
-
border-radius:
|
|
23
|
+
border-radius: var(--sys-shape-corner-full);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
div.verbose {
|
|
@@ -247,6 +247,12 @@
|
|
|
247
247
|
.tabbed-pane-shadow.vertical-tab-layout .tabbed-pane-content {
|
|
248
248
|
padding-top: var(--sys-size-10);
|
|
249
249
|
overflow-x: hidden;
|
|
250
|
+
|
|
251
|
+
slot::slotted(.widget) {
|
|
252
|
+
/* '!important' in order to overwrite the slotted widget's 'overflow-auto' class.
|
|
253
|
+
This prevents the focus-ring of selectable elements from being cut off. */
|
|
254
|
+
overflow: visible !important; /* stylelint-disable-line declaration-no-important */
|
|
255
|
+
}
|
|
250
256
|
}
|
|
251
257
|
|
|
252
258
|
.tabbed-pane-shadow.vertical-tab-layout .tabbed-pane-header-contents {
|
|
@@ -2,13 +2,15 @@
|
|
|
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
4
|
|
|
5
|
+
import * as Platform from '../../core/platform/platform.js';
|
|
5
6
|
import * as Lit from '../../third_party/lit/lit.js';
|
|
6
7
|
|
|
7
8
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
8
9
|
export type BindingEventListener = (arg: any) => any;
|
|
9
10
|
|
|
10
11
|
export class InterceptBindingDirective extends Lit.Directive.Directive {
|
|
11
|
-
static readonly #interceptedBindings =
|
|
12
|
+
static readonly #interceptedBindings =
|
|
13
|
+
new WeakMap<Element, {bindings: Map<string, BindingEventListener>, lastAttachment?: WeakRef<Element>}>();
|
|
12
14
|
static readonly #attachedBindings = new WeakMap<Element, Map<string, Set<BindingEventListener>>>();
|
|
13
15
|
|
|
14
16
|
override update(part: Lit.Directive.Part, [listener]: [BindingEventListener]): unknown {
|
|
@@ -17,14 +19,42 @@ export class InterceptBindingDirective extends Lit.Directive.Directive {
|
|
|
17
19
|
}
|
|
18
20
|
let eventListeners = InterceptBindingDirective.#interceptedBindings.get(part.element);
|
|
19
21
|
if (!eventListeners) {
|
|
20
|
-
eventListeners = new Map();
|
|
22
|
+
eventListeners = {bindings: new Map()};
|
|
21
23
|
InterceptBindingDirective.#interceptedBindings.set(part.element, eventListeners);
|
|
22
24
|
}
|
|
23
|
-
|
|
25
|
+
|
|
26
|
+
InterceptBindingDirective.#updateAttachedListener(part.element, part.name, listener);
|
|
27
|
+
eventListeners.bindings.set(part.name, listener);
|
|
24
28
|
|
|
25
29
|
return this.render(listener);
|
|
26
30
|
}
|
|
27
31
|
|
|
32
|
+
static #updateAttachedListener(templateElement: Element, name: string, listener: BindingEventListener): void {
|
|
33
|
+
const binding = this.#interceptedBindings.get(templateElement);
|
|
34
|
+
if (!binding) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
const lastAttachment = binding.lastAttachment?.deref();
|
|
38
|
+
if (!lastAttachment) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
const oldListener = binding.bindings.get(name);
|
|
42
|
+
if (oldListener === listener) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
const attachedBindings = this.#attachedBindings.get(lastAttachment);
|
|
46
|
+
if (!attachedBindings) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
const attachedListeners = Platform.MapUtilities.getWithDefault(attachedBindings, name, () => new Set());
|
|
50
|
+
if (oldListener) {
|
|
51
|
+
lastAttachment.removeEventListener(name, oldListener);
|
|
52
|
+
attachedListeners.delete(oldListener);
|
|
53
|
+
}
|
|
54
|
+
lastAttachment.addEventListener(name, listener);
|
|
55
|
+
attachedListeners.add(listener);
|
|
56
|
+
}
|
|
57
|
+
|
|
28
58
|
/* eslint-disable-next-line @typescript-eslint/no-unsafe-function-type */
|
|
29
59
|
render(listener: Function): Function {
|
|
30
60
|
return listener;
|
|
@@ -45,7 +75,8 @@ export class InterceptBindingDirective extends Lit.Directive.Directive {
|
|
|
45
75
|
for (const templateElement of elements) {
|
|
46
76
|
const newListeners = InterceptBindingDirective.#interceptedBindings.get(templateElement);
|
|
47
77
|
if (newListeners) {
|
|
48
|
-
|
|
78
|
+
newListeners.lastAttachment = new WeakRef(renderedElement);
|
|
79
|
+
for (const [name, listener] of newListeners.bindings) {
|
|
49
80
|
renderedElement.addEventListener(name, listener);
|
|
50
81
|
let listenersSet = newAttachedListeners.get(name);
|
|
51
82
|
if (!listenersSet) {
|
|
@@ -63,18 +94,4 @@ export class InterceptBindingDirective extends Lit.Directive.Directive {
|
|
|
63
94
|
InterceptBindingDirective.#attachedBindings.delete(renderedElement);
|
|
64
95
|
}
|
|
65
96
|
}
|
|
66
|
-
|
|
67
|
-
static registerListeners(element: Element, listeners?: Record<string, EventListenerOrEventListenerObject>): void {
|
|
68
|
-
if (!listeners) {
|
|
69
|
-
InterceptBindingDirective.#interceptedBindings.delete(element);
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
const map = new Map<string, BindingEventListener>();
|
|
73
|
-
for (const [name, listener] of Object.entries(listeners)) {
|
|
74
|
-
map.set(name,
|
|
75
|
-
typeof listener === 'function' ? listener as BindingEventListener :
|
|
76
|
-
listener.handleEvent.bind(listener) as BindingEventListener);
|
|
77
|
-
}
|
|
78
|
-
InterceptBindingDirective.#interceptedBindings.set(element, map);
|
|
79
|
-
}
|
|
80
97
|
}
|
package/front_end/ui/lit/lit.ts
CHANGED
|
@@ -5,14 +5,11 @@
|
|
|
5
5
|
|
|
6
6
|
import * as Lit from '../../third_party/lit/lit.js';
|
|
7
7
|
|
|
8
|
-
import {InterceptBindingDirective} from './Directives.js';
|
|
9
|
-
|
|
10
8
|
export interface RenderOptions extends Lit.RenderOptions {
|
|
11
9
|
container?: {
|
|
12
10
|
attributes?: Record<string, string|null|boolean|undefined|{toString(): string}>,
|
|
13
11
|
classes?: string[],
|
|
14
12
|
listeners?: Record<string, EventListenerOrEventListenerObject>,
|
|
15
|
-
interceptedListeners?: Record<string, EventListenerOrEventListenerObject>,
|
|
16
13
|
};
|
|
17
14
|
}
|
|
18
15
|
|
|
@@ -116,10 +113,6 @@ export function render(template: unknown, container: HTMLElement|DocumentFragmen
|
|
|
116
113
|
}
|
|
117
114
|
}
|
|
118
115
|
|
|
119
|
-
if (host instanceof Element) {
|
|
120
|
-
InterceptBindingDirective.registerListeners(host, options?.container?.interceptedListeners);
|
|
121
|
-
}
|
|
122
|
-
|
|
123
116
|
renderOptions.set(container, options);
|
|
124
117
|
return Lit.render(template, container, options);
|
|
125
118
|
}
|
|
@@ -316,6 +316,7 @@ export const knownContextValues: Set<string> = new Set([
|
|
|
316
316
|
'add-button',
|
|
317
317
|
'add-cnd-breakpoint',
|
|
318
318
|
'add-color',
|
|
319
|
+
'add-comment',
|
|
319
320
|
'add-content-scripts-to-ignorelist',
|
|
320
321
|
'add-count',
|
|
321
322
|
'add-custom-device',
|
|
@@ -901,6 +902,7 @@ export const knownContextValues: Set<string> = new Set([
|
|
|
901
902
|
'code-snippets-explainer.patch-widget',
|
|
902
903
|
'code-whisperer',
|
|
903
904
|
'collapse',
|
|
905
|
+
'collapse-all',
|
|
904
906
|
'collapse-children',
|
|
905
907
|
'collapse-non-contributing-css-rules',
|
|
906
908
|
'collapsed-files',
|
|
@@ -961,6 +963,7 @@ export const knownContextValues: Set<string> = new Set([
|
|
|
961
963
|
'command-input',
|
|
962
964
|
'comment-thread',
|
|
963
965
|
'comments',
|
|
966
|
+
'comments-add-comment',
|
|
964
967
|
'comments-drawer',
|
|
965
968
|
'comments-input',
|
|
966
969
|
'comments-see-response',
|
|
@@ -3370,6 +3373,7 @@ export const knownContextValues: Set<string> = new Set([
|
|
|
3370
3373
|
'privacy-policy.console-insights',
|
|
3371
3374
|
'privacy-sandbox-update',
|
|
3372
3375
|
'private-state-tokens',
|
|
3376
|
+
'private-verification-tokens',
|
|
3373
3377
|
'processing-instruction-value',
|
|
3374
3378
|
'production-origin',
|
|
3375
3379
|
'profile-item',
|
|
@@ -4046,6 +4050,7 @@ export const knownContextValues: Set<string> = new Set([
|
|
|
4046
4050
|
'source-map-failed',
|
|
4047
4051
|
'source-map-infobar-disabled',
|
|
4048
4052
|
'source-map-loaded',
|
|
4053
|
+
'source-map-scopes-in-sources-panel',
|
|
4049
4054
|
'source-map-skipped',
|
|
4050
4055
|
'source-map-skipped-infobar-disabled',
|
|
4051
4056
|
'source-message',
|
package/package.json
CHANGED
package/vpython.toml
ADDED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: review-models-core
|
|
3
|
-
description: >-
|
|
4
|
-
Reviews Chrome DevTools frontend changes in path group models-and-core (^front_end/(core|models|entrypoints|generated)/, BUILD\.gn$, \.gni$),
|
|
5
|
-
strictly reflecting review standards, architectural invariants, and security boundaries
|
|
6
|
-
derived from historical code reviews.
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
# Chrome DevTools frontend reviewer skill: models-and-core
|
|
10
|
-
|
|
11
|
-
This skill provides review guidance for Chrome DevTools frontend changes matching the `models-and-core` path group (^front_end/(core|models|entrypoints|generated)/, BUILD\.gn$, \.gni$). Every rule below recurred in at least 5 CLs from 2 distinct reviewers in historical reviews; cite the rule id in findings.
|
|
12
|
-
|
|
13
|
-
## Path group `models-and-core` (10 rules)
|
|
14
|
-
|
|
15
|
-
### `CORE_TRACE_ENGINE_HANDLER_INVARIANTS`: Normalize and precompute trace events in handler finalize passes using Types.Events.is* guards while keeping raw events immutable
|
|
16
|
-
- **Severity**: ERROR
|
|
17
|
-
- **Why**: Trace handlers (`front_end/models/trace/handlers/`) must normalize synthetic event fields, validate bounds, and group events once during `finalize()` so downstream insights and UI tracks do not repeatedly filter the raw trace array or mutate raw trace event objects.
|
|
18
|
-
- **Look for**: In-place property mutation of raw trace events, repeated full-trace `.filter()` scans inside insight calculators instead of handler precomputation, or ad-hoc property checks instead of `Types.Events.is*` (or `Trace.Types.Events.is*`) type guards.
|
|
19
|
-
- **Do not flag**: Constructing new synthetic trace event objects owned by the handler during `finalize()`.
|
|
20
|
-
|
|
21
|
-
### `CORE_SDK_MODEL_AND_TARGET_LIFECYCLE`: Manage SDK model and sub-target state on scoped manager instances using O(1) indexed maps rather than module globals or linear scans
|
|
22
|
-
- **Severity**: ERROR
|
|
23
|
-
- **Why**: Storing model tracking collections (`Set`/`Map`) at module scope leaks state across multiple `TestUniverse` instances and targets, while failing to track OOPIF/worker sub-targets or scanning DOM trees linearly for frame nodes causes bugs and $O(N)$ bottlenecks.
|
|
24
|
-
- **Look for**: Module-level `const tracked = new Map/Set()` in `core/sdk/` or `models/bindings/`, linear DOM tree traversals for frame/node lookups instead of indexed `Map`s, or target listeners that ignore sub-target attachment/detachment.
|
|
25
|
-
- **Do not flag**: Immutable module-level `Set` or `Map` lookup tables of constant string literals. Properties marked required (non-optional) in generated `front_end/generated/protocol.ts` CDP types (do not ask for redundant runtime null/undefined checks on them), or `node.shadowRoots()[0]` accesses (elements have at most one shadow root; the array return type is a legacy Shadow DOM v0 artifact).
|
|
26
|
-
|
|
27
|
-
### `CORE_GN_BUILD_AND_MODULE_LAYERING`: Enforce strict GN bundle visibility, declare complete deps/ts_deps, and never import UI or panel modules from foundation layers
|
|
28
|
-
- **Severity**: ERROR
|
|
29
|
-
- **Why**: DevTools enforces a strict DAG where `core/` and `models/` (`foundation`) must never depend on `ui/` or `panels/`. In `BUILD.gn`, modules must depend on `:bundle` targets across directories, register new files in `devtools_grd_files.gni` and `foundation_unittests`, and restrict panel `visibility`.
|
|
30
|
-
- **Look for**: Imports of `ui/` or `panels/` inside `core/` or `models/`, `visibility = [ "*" ]` on new panel `BUILD.gn` targets, direct internal file imports across module boundaries instead of `:bundle` namespace imports, or missing `foundation_unittests` entries.
|
|
31
|
-
- **Do not flag**: Core utility libraries intentionally exposed to the entire codebase with `visibility = [ "*" ]`.
|
|
32
|
-
|
|
33
|
-
### `CORE_AI_AGENT_CONTEXT_AND_PROMPT_DISCIPLINE`: Keep AI agent prompts, tool schemas, and data formatters deterministic, token-efficient, and decoupled from UI and locale state
|
|
34
|
-
- **Severity**: WARNING
|
|
35
|
-
- **Why**: AI agent data formatters (`models/ai_assistance/data_formatters/`) must produce deterministic, unlocalized, concise text representations decoupled from UI widgets and trace insight models, while tools must declare explicit permission policies and flatten verbose CDP types.
|
|
36
|
-
- **Look for**: Localized `i18nString` calls or verbose boilerplate prose inside AI data formatters, unsorted flag/property lists in prompt serializers, AI tools missing permission policy declarations, or monolithic trace models passed to response widgets.
|
|
37
|
-
- **Do not flag**: User-facing UI labels rendered in the AI assistance panel chrome rather than sent to the LLM.
|
|
38
|
-
|
|
39
|
-
### `CORE_RUNTIME_NEUTRALITY_AND_PLATFORM_UTILS`: Maintain runtime neutrality in foundation modules using Platform.HostRuntime, globalThis, and centralized core/platform utilities
|
|
40
|
-
- **Severity**: ERROR
|
|
41
|
-
- **Why**: Foundation modules (`core/` and `models/`) run in both browser DevTools and headless Node.js/worker environments (such as trace analysis and MCP servers). Accessing `window`, `navigator.userAgent`, or `document` directly breaks non-browser runtimes, and duplicating MIME/string/deferred utilities causes subtle bugs.
|
|
42
|
-
- **Look for**: `navigator.userAgent`, `window.setTimeout`, `window.atob`, manual `new Promise(r => { resolve = r; })` deferreds instead of `Promise.withResolvers()`, or ad-hoc MIME/escaping regexes in `core/` and `models/`.
|
|
43
|
-
- **Do not flag**: Browser-only UI components in `front_end/panels/` or `front_end/ui/`.
|
|
44
|
-
|
|
45
|
-
### `CORE_CDP_AND_EXTENSION_ERROR_HANDLING`: Handle CDP ProtocolResponseWithError and ContentDataOrError explicitly, release RemoteObject handles in finally blocks, and return Promises
|
|
46
|
-
- **Severity**: ERROR
|
|
47
|
-
- **Why**: CDP agent calls and `requestContentData()` resolve to error-bearing response objects (`getError()`, `ContentData.isError()`) rather than throwing, so wrapping them in `try/catch` is misleading. Furthermore, temporary `RemoteObject` handles must be released in `finally` blocks, and extension APIs must reject with sanitized `Error` instances.
|
|
48
|
-
- **Look for**: `try { await ...invoke_*() }` or `try { await request.requestContentData() }` blocks, `Runtime.evaluate` calls creating `RemoteObject`s without `release()` in `finally`, callback-taking SDK methods instead of `Promise`, or `reject(rawObject)` in `ExtensionAPI.ts`.
|
|
49
|
-
- **Do not flag**: `try/catch` blocks that wrap subsequent throwing operations like `JSON.parse()`. Properties marked required (non-optional) in generated `front_end/generated/protocol.ts` CDP types (do not ask for redundant runtime null/undefined checks on them), or `node.shadowRoots()[0]` accesses (elements have at most one shadow root; the array return type is a legacy Shadow DOM v0 artifact).
|
|
50
|
-
|
|
51
|
-
### `CORE_SECURITY_ORIGIN_AND_CAPABILITY_GUARDS`: Enforce security origin validation, enterprise policy guards, and branded UrlString types in the model and host layers
|
|
52
|
-
- **Severity**: ERROR
|
|
53
|
-
- **Why**: Security origin checks (SOP), workspace access boundaries, and enterprise/geo-restriction capability checks must be enforced in `core/` and `models/` using `SecurityOrigin`, `Common.ParsedURL`, and `Platform.DevToolsPath.UrlString` rather than relying on UI-layer checks or unvalidated source URLs.
|
|
54
|
-
- **Look for**: Unbranded `string` URLs in model/agent interfaces instead of `Platform.DevToolsPath.UrlString`, security origin checks performed only in UI views, or resource lookup errors returned before permission checks in `ExtensionServer`.
|
|
55
|
-
- **Do not flag**: Internal display-only label strings that are never used for resource resolution or security checks.
|
|
56
|
-
|
|
57
|
-
### `CORE_SOURCEMAP_AND_WORKSPACE_MAPPING`: Handle source map parsing, inline script offset translation, and scope tree resolution fault-tolerantly
|
|
58
|
-
- **Severity**: ERROR
|
|
59
|
-
- **Why**: Real-world source maps and inline `<script>` tags frequently contain malformed fields, UTF-8 characters, or non-zero line/column offsets. Source map consumers must translate raw inline script locations to relative locations, use UTF-8-safe URI encoding (`encodeURIComponent` with `try/catch` instead of `btoa`), and guard scope stack traversals.
|
|
60
|
-
- **Look for**: `window.btoa` on source map strings containing UTF-8, raw script locations passed to source map lookups without `rawLocationToRelativeLocation`, or unguarded `encodeURIComponent` / `JSON.parse` on external source map payloads.
|
|
61
|
-
- **Do not flag**: ASCII-only binary buffer encoding via `Common.Base64.encode`.
|
|
62
|
-
|
|
63
|
-
### `CORE_SETTINGS_AND_STORAGE_MIGRATION`: Guard settings and storage migrations with try/catch, preserve user preferences across renames, and clean up obsolete flags
|
|
64
|
-
- **Severity**: ERROR
|
|
65
|
-
- **Why**: Corrupted `localStorage` payloads or legacy setting schemas can throw during `JSON.parse` and break DevTools startup unless caught and reset. When migrating setting keys or storage formats, existing user selections must be migrated rather than overwritten.
|
|
66
|
-
- **Look for**: Unprotected `JSON.parse()` in `Settings.ts` or storage classes, setting key renames that discard previously stored user preferences, or experiment removals that leave orphaned `localStorage` keys behind.
|
|
67
|
-
- **Do not flag**: In-memory parsing of static constant JSON fixtures.
|
|
68
|
-
|
|
69
|
-
### `CORE_TRACE_INSIGHT_MODELS_AND_TIMING_TYPES`: Enforce branded timing types (Micro, Milli) in trace models and keep types.ts and insight models free of executable or presentation logic
|
|
70
|
-
- **Severity**: ERROR
|
|
71
|
-
- **Why**: Mixing microseconds and milliseconds causes 1000x calculation bugs across trace insights; branded types (`Types.Timing.Micro`, `Types.Timing.Milli`) and canonical conversion helpers (such as `Trace.Helpers.Timing.microToMilli` or `Platform.Timing.microSecondsToMilliSeconds`) prevent unit confusion. Placing executable functions in `types.ts` or UI/AI formatting in insight models violates trace architecture.
|
|
72
|
-
- **Look for**: Manual `/ 1000` or `* 1000` arithmetic on trace timestamps, executable functions placed in `models/trace/**/types.ts`, or CSS/DOM/AI markdown formatting inside `models/trace/insights/`.
|
|
73
|
-
- **Do not flag**: Type guard functions (`is*`) in `Trace.Types.Events` that only perform type predicate checks.
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: review-tests
|
|
3
|
-
description: >-
|
|
4
|
-
Reviews Chrome DevTools frontend changes in target directories (\.test\.ts$, ^test/, ^front_end/testing/),
|
|
5
|
-
strictly reflecting review standards, architectural invariants, and security boundaries
|
|
6
|
-
derived from historical code reviews.
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
# Chrome DevTools frontend reviewer skill: tests
|
|
10
|
-
|
|
11
|
-
This skill provides review guidance for Chrome DevTools frontend changes matching the target directories (\.test\.ts$, ^test/, ^front_end/testing/). It focuses specifically on code review verification for test changes, complementing authoring guidance in `devtools-testing-guidance` and integrating with the general review checklist in `code-review`. Every rule below recurred in at least 5 CLs from 2 distinct reviewers in historical reviews; cite the rule id in findings.
|
|
12
|
-
|
|
13
|
-
## Path group `tests` (9 rules)
|
|
14
|
-
|
|
15
|
-
### `TEST_SHARED_FIXTURE_AND_HELPER_REUSE`: Reuse canonical front_end/testing helpers and beforeEach setup without mutating cached shared fixtures
|
|
16
|
-
- **Severity**: WARNING
|
|
17
|
-
- **Why**: Duplicating mock factories (`createTarget`, `createNetworkRequest`, `mockAidaClient`, `cleanTextContent`) or mutating cached objects returned by `TraceLoader` causes cross-test state corruption and maintenance drift across the test suite.
|
|
18
|
-
- **Look for**: Custom inline network request or AIDA client mocks in `.test.ts` files, in-place mutation of `parsedTrace` objects returned by `TraceLoader`, or manual `div` container creation around `renderElementIntoDOM(widget)`.
|
|
19
|
-
- **Do not flag**: Specialized test helpers inside `front_end/testing/` that define the canonical factory implementations themselves.
|
|
20
|
-
|
|
21
|
-
### `TEST_MODULAR_HOOKS_AND_TEST_UNIVERSE`: Use lightweight modular setup hooks and TestUniverse instead of heavyweight describeWithEnvironment wrappers
|
|
22
|
-
- **Severity**: WARNING
|
|
23
|
-
- **Why**: Wrapping unit tests in `describeWithEnvironment` initializes all DevTools global singletons and settings, slowing down tests and hiding implicit global dependencies. Tests should use `TestUniverse` or granular hooks (`setupLocaleHooks()`, `setupSettingsHooks()`, `updateHostConfig()`) and never mix `TestUniverse` with `describeWithEnvironment`.
|
|
24
|
-
- **Look for**: `describeWithEnvironment` in unit tests that only need locale, settings, or `TestUniverse`, or suites combining `new TestUniverse()` with `describeWithEnvironment`, or direct mutation of `Root.Runtime.hostConfig` instead of `updateHostConfig(...)`.
|
|
25
|
-
- **Do not flag**: Integration-style panel tests that exercise legacy singleton classes not yet migrated to `Universe` dependency injection. Bot-only CLI flags, credentials, or standalone runner scripts under `test/conductor/` or `test/ai_evals/` that do not run inside the standard Mocha unit test harness.
|
|
26
|
-
|
|
27
|
-
### `TEST_DETERMINISTIC_ASYNC_SYNCHRONIZATION`: Synchronize asynchronous test assertions using lifecycle promises, expectCall, or raf instead of arbitrary setTimeout delays
|
|
28
|
-
- **Severity**: ERROR
|
|
29
|
-
- **Why**: Waiting on wall-clock `setTimeout` delays or arbitrary microtask ticks makes unit tests slow and flaky under CPU contention on CI bots. Tests should await explicit widget update promises (`await widget.updateComplete`), event promises (`target.once(...)`), stub invocation helpers (`expectCall(stub)`), or `raf()`.
|
|
30
|
-
- **Look for**: `new Promise(r => setTimeout(r, ...))` in `.test.ts` files, synchronous DOM assertions immediately after `requestUpdate()`, or redundant `clock.tick()` calls when no fake timers are pending.
|
|
31
|
-
- **Do not flag**: Tests specifically verifying debounce/throttle timer expiration using `sinon.useFakeTimers()`.
|
|
32
|
-
|
|
33
|
-
### `TEST_STRICT_ASSERTIONS_AND_LITERAL_EXPECTATIONS`: Use strict Chai and Sinon assertions against literal expected values rather than assert.isNotNull on undefined-unions or conditional guards
|
|
34
|
-
- **Severity**: ERROR
|
|
35
|
-
- **Why**: Calling `assert.isNotNull(x)` on a value typed as `T | undefined` passes when `x` is `undefined`, silently skipping assertions. Similarly, wrapping assertions inside `if (el)` or computing expected values by calling the same production helper under test allows broken code to pass.
|
|
36
|
-
- **Look for**: `assert.isNotNull(...)` on `container?.querySelector` / `Map.get` / `Array.find` / optional properties, `if (el) { assert... }` blocks, `assert.isTrue(spy.called)` instead of `sinon.assert.calledWith`, or assertions comparing output against production formatting helpers.
|
|
37
|
-
- **Do not flag**: Variables whose static return type is strictly `T | null` (and never `undefined`).
|
|
38
|
-
|
|
39
|
-
### `TEST_VIEW_AND_PRESENTER_ISOLATION`: Test presenters via createViewFunctionStub and test pure view functions directly without piercing internal DOM structures
|
|
40
|
-
- **Severity**: WARNING
|
|
41
|
-
- **Why**: In DevTools' MVP (`UI.Widget` + `DEFAULT_VIEW`) architecture, presenter tests should follow the view stubbing conventions documented in [`docs/ui_engineering.md`](../../../docs/ui_engineering.md) by stubbing the view function with `createViewFunctionStub(Presenter)` and asserting on `await view.nextInput`, while view rendering tests should invoke `DEFAULT_VIEW(input, output, target)` directly or use screenshot assertions.
|
|
42
|
-
- **Look for**: Presenter tests instantiating full DOM trees and querying shadow/child DOM selectors to simulate clicks when the widget accepts a `view` function, or view tests instantiating full presenters just to test template markup.
|
|
43
|
-
- **Do not flag**: Legacy widgets that have not yet separated their template rendering into a standalone `DEFAULT_VIEW` function.
|
|
44
|
-
|
|
45
|
-
### `TEST_PUBLIC_API_AND_ENCAPSULATION`: Exercise classes through public APIs and constructor-injected dependencies rather than accessing private members or stubbing unused singletons
|
|
46
|
-
- **Severity**: WARNING
|
|
47
|
-
- **Why**: Accessing `#private` or `private` methods via `(instance as any)` or `@ts-expect-error`, piercing child component shadow roots, or stubbing `Class.instance()` when dependencies are already passed via constructor couples tests to internal implementation details.
|
|
48
|
-
- **Look for**: `@ts-expect-error` or `(obj as any).privateMethod()` calls in `.test.ts` files, `sinon.stub(Class, 'instance')` alongside `new UnderTest(mockInstance)`, or `child.shadowRoot.querySelector(...)` inside parent component tests.
|
|
49
|
-
- **Do not flag**: Intentional negative type tests documented with an explanatory `@ts-expect-error` comment.
|
|
50
|
-
|
|
51
|
-
### `TEST_SINGLE_RESPONSIBILITY_AND_CONCISENESS`: Keep each it() block focused on a single behavior and prune duplicate or obsolete tests when features change
|
|
52
|
-
- **Severity**: WARNING
|
|
53
|
-
- **Why**: Combining multiple independent user interactions or feature scenarios into a single monolithic `it()` block obscures failure root causes, while leaving duplicate or orphaned tests behind increases suite runtime and maintenance burden.
|
|
54
|
-
- **Look for**: `it('... and ...')` blocks testing multiple orthogonal interactions sequentially, nested `{ ... }` scope blocks inside a single `it()`, or identical test cases duplicated across `describe` blocks.
|
|
55
|
-
- **Do not flag**: Multi-step stateful workflow tests where earlier steps are required preconditions to reach the state under test.
|
|
56
|
-
|
|
57
|
-
### `TEST_TYPE_SAFE_MOCKS_AND_EVENTS`: Construct typed stubs and real DOM or event instances instead of casting fake objects with as unknown as
|
|
58
|
-
- **Severity**: WARNING
|
|
59
|
-
- **Why**: Casting partial object literals via `as unknown as T` or `as any` bypasses TypeScript compile-time checks, masks missing methods when interfaces evolve, and causes brittle runtime failures. Using `sinon.createStubInstance(Class)`, real DOM/Event constructors (`DataTransfer`, `ClipboardEvent`), or typed fixture helpers preserves type safety.
|
|
60
|
-
- **Look for**: `as unknown as` or `as any` casts on mock objects, fake DOM nodes, or synthetic events in `.test.ts` files, or untyped `querySelector(...) as HTMLElement` calls.
|
|
61
|
-
- **Do not flag**: Tests explicitly verifying runtime handling of malformed untrusted payloads or narrow generic type parameters inside shared `front_end/testing/` helpers.
|
|
62
|
-
|
|
63
|
-
### `TEST_CLEANUP_MUTATED_GLOBALS_AND_WIDGETS`: Restore mutated global properties and detach manually instantiated widgets or singletons in afterEach or finally blocks
|
|
64
|
-
- **Severity**: WARNING
|
|
65
|
-
- **Why**: While Sinon stubs are restored automatically, direct mutations to `window`, `globalThis`, prototypes, or `localStorage`, as well as widgets and panels instantiated with `.markAsRoot()` or `show()`, persist across tests and leak listeners unless explicitly cleaned up in `afterEach` or `try...finally`.
|
|
66
|
-
- **Look for**: Direct assignments to `window.*`, `globalThis.*`, `Object.prototype.*`, `localStorage.*`, or `panel.show(document.body)` in `.test.ts` files without a matching restoration or `detach()` in `afterEach` or `finally`.
|
|
67
|
-
- **Do not flag**: Widgets mounted directly via `renderElementIntoDOM(widget)`, which detaches widgets automatically during global harness teardown.
|