chrome-devtools-frontend 1.0.1711155 → 1.0.1713292

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.
Files changed (102) hide show
  1. package/.agents/skills/code-review/SKILL.md +16 -12
  2. package/AUTHORS +1 -0
  3. package/DIR_METADATA +36 -0
  4. package/front_end/core/sdk/CSSStyleSheetHeader.ts +2 -2
  5. package/front_end/core/sdk/CompilerSourceMappingContentProvider.ts +1 -1
  6. package/front_end/core/sdk/NetworkRequest.ts +11 -11
  7. package/front_end/core/sdk/ResourceTreeModel.ts +17 -1
  8. package/front_end/core/sdk/SourceMap.ts +6 -0
  9. package/front_end/core/sdk/SourceMapScopesInfo.ts +25 -0
  10. package/front_end/entrypoints/inspector_main/inspector_main-meta.ts +7 -7
  11. package/front_end/generated/InspectorBackendCommands.ts +1 -1
  12. package/front_end/generated/protocol.ts +6 -0
  13. package/front_end/models/bindings/SourceMapStepping.ts +29 -2
  14. package/front_end/models/issues_manager/Issue.ts +1 -1
  15. package/front_end/models/javascript_metadata/NativeFunctions.ts +14 -6
  16. package/front_end/models/trace/Processor.ts +9 -3
  17. package/front_end/models/trace/extras/TraceTree.ts +1 -1
  18. package/front_end/models/trace/insights/CLSCulprits.ts +1 -1
  19. package/front_end/panels/accessibility/AccessibilityAnnouncementRecordingListView.ts +40 -8
  20. package/front_end/panels/accessibility/AccessibilityAnnouncementRecordingView.ts +108 -2
  21. package/front_end/panels/accessibility/AccessibilityNodeView.ts +2 -2
  22. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +1 -1
  23. package/front_end/panels/ai_assistance/components/DisabledWidget.ts +1 -1
  24. package/front_end/panels/ai_assistance/components/OptInChangeDialog.ts +1 -1
  25. package/front_end/panels/application/ServiceWorkerUpdateCycleView.ts +3 -2
  26. package/front_end/panels/application/WebMCPView.ts +6 -2
  27. package/front_end/panels/application/components/AdsView.ts +28 -29
  28. package/front_end/panels/application/components/BackForwardCacheStrings.ts +188 -204
  29. package/front_end/panels/application/components/BackForwardCacheView.ts +33 -45
  30. package/front_end/panels/application/components/BounceTrackingMitigationsView.ts +10 -12
  31. package/front_end/panels/application/components/CrashReportContextGrid.ts +4 -4
  32. package/front_end/panels/application/components/EndpointsGrid.ts +3 -5
  33. package/front_end/panels/application/components/PermissionsPolicySection.ts +12 -15
  34. package/front_end/panels/application/components/ProtocolHandlersView.ts +9 -9
  35. package/front_end/panels/application/components/ReportsGrid.ts +7 -12
  36. package/front_end/panels/application/components/StorageMetadataView.ts +22 -24
  37. package/front_end/panels/application/components/TrustTokensView.ts +8 -10
  38. package/front_end/panels/application/preloading/components/PreloadingString.ts +28 -29
  39. package/front_end/panels/application/serviceWorkerUpdateCycleView.css +1 -1
  40. package/front_end/panels/comments/CommentsPane.ts +14 -7
  41. package/front_end/panels/comments/commentsPane.css +6 -20
  42. package/front_end/panels/common/CPUThrottlingOption.ts +1 -1
  43. package/front_end/panels/console/ConsoleInsightTeaser.ts +1 -1
  44. package/front_end/panels/console/ConsoleViewMessage.ts +1 -0
  45. package/front_end/panels/console/ConsoleViewport.ts +35 -4
  46. package/front_end/panels/coverage/CoverageListView.ts +2 -2
  47. package/front_end/panels/coverage/CoverageView.ts +2 -2
  48. package/front_end/panels/elements/CSSRuleValidator.ts +1 -1
  49. package/front_end/panels/elements/DOMTreeWidget.ts +12 -19
  50. package/front_end/panels/elements/ElementsPanel.ts +3 -3
  51. package/front_end/panels/elements/StylePropertyTreeElement.ts +1 -1
  52. package/front_end/panels/elements/components/CSSVariableValueView.ts +1 -1
  53. package/front_end/panels/elements/elements-meta.ts +3 -3
  54. package/front_end/panels/explain/components/ConsoleInsight.ts +1 -1
  55. package/front_end/panels/issues/AffectedSharedArrayBufferIssueDetailsView.ts +2 -3
  56. package/front_end/panels/linear_memory_inspector/LinearMemoryInspectorController.ts +1 -1
  57. package/front_end/panels/network/FetchHeaderCommenting.ts +1 -1
  58. package/front_end/panels/network/NetworkDataGridNode.ts +2 -2
  59. package/front_end/panels/network/RequestConditionsDrawer.ts +2 -2
  60. package/front_end/panels/network/RequestCookiesView.ts +1 -1
  61. package/front_end/panels/network/RequestDeviceBoundSessionsView.ts +3 -3
  62. package/front_end/panels/network/components/RequestHeaderSection.ts +1 -1
  63. package/front_end/panels/network/components/ResponseHeaderSection.ts +1 -1
  64. package/front_end/panels/recorder/RecordingView.ts +1 -1
  65. package/front_end/panels/sensors/LocationsSettingsTab.ts +4 -9
  66. package/front_end/panels/sensors/SensorsView.ts +2 -2
  67. package/front_end/panels/sensors/sensors-meta.ts +0 -83
  68. package/front_end/panels/settings/AISettingsTab.ts +5 -5
  69. package/front_end/panels/settings/BackendLinkingSettingsTab.ts +1 -1
  70. package/front_end/panels/settings/emulation/DevicesSettingsTab.ts +4 -4
  71. package/front_end/panels/sources/BreakpointEditDialog.ts +1 -1
  72. package/front_end/panels/sources/DebuggerPlugin.ts +1 -1
  73. package/front_end/panels/sources/FilteredUISourceCodeListProvider.ts +4 -1
  74. package/front_end/panels/sources/NavigatorView.ts +9 -6
  75. package/front_end/panels/sources/PersistenceActions.ts +1 -1
  76. package/front_end/panels/sources/SourcesPanel.ts +17 -8
  77. package/front_end/panels/sources/SourcesSearchScope.ts +4 -1
  78. package/front_end/panels/sources/SourcesView.ts +79 -86
  79. package/front_end/panels/sources/sources-meta.ts +26 -63
  80. package/front_end/panels/timeline/CountersGraph.ts +18 -8
  81. package/front_end/panels/timeline/TimelinePanel.ts +12 -5
  82. package/front_end/panels/timeline/TimelineUIUtils.ts +1 -1
  83. package/front_end/panels/timeline/overlays/components/EntryLabelOverlay.ts +4 -4
  84. package/front_end/panels/timeline/timeline-meta.ts +11 -21
  85. package/front_end/third_party/chromium/README.chromium +1 -1
  86. package/front_end/ui/components/lists/list.css +1 -2
  87. package/front_end/ui/components/suggestion_input/SuggestionInput.ts +9 -5
  88. package/front_end/ui/components/text_editor/AiCodeCompletionDisclaimer.ts +3 -3
  89. package/front_end/ui/components/text_editor/AiCodeCompletionTeaser.ts +1 -1
  90. package/front_end/ui/components/text_editor/AiCodeGenerationTeaser.ts +3 -3
  91. package/front_end/ui/components/text_editor/AiCodeGenerationUpgradeDialog.ts +1 -1
  92. package/front_end/ui/components/text_editor/config.ts +3 -3
  93. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +1 -0
  94. package/front_end/ui/legacy/components/perf_ui/ChartViewport.ts +4 -1
  95. package/front_end/ui/legacy/components/perf_ui/perf_ui-meta.ts +2 -5
  96. package/front_end/ui/legacy/listWidget.css +1 -6
  97. package/front_end/ui/settings/EmulationSettings.ts +91 -0
  98. package/front_end/ui/settings/SourcesSettings.ts +58 -0
  99. package/front_end/ui/settings/TimelineSettings.ts +28 -0
  100. package/front_end/ui/settings/settings.ts +2 -0
  101. package/front_end/ui/visual_logging/KnownContextValues.ts +1 -0
  102. package/package.json +1 -1
@@ -10,17 +10,21 @@ Use it for self-review before upload and for reviewing other people's CLs.
10
10
 
11
11
  ## 1. Gather context
12
12
 
13
- - **Local change:** `git diff origin/main...HEAD` (or `git show HEAD` for a
14
- single-commit branch). To learn about the branch and upload workflow, see the
15
- `devtools-version-control` skill.
16
- - **Gerrit CL:** strip the leading `)]}'` line from each response to get JSON:
17
- - Diff: `git cl diff` (for the current branch), or fetch the patch set.
18
- - Inline comments:
19
- `curl -s https://chromium-review.googlesource.com/changes/devtools%2Fdevtools-frontend~<CL_NUMBER>/comments | tail -n +2`
20
- - Messages:
21
- `.../changes/devtools%2Fdevtools-frontend~<CL_NUMBER>/messages`
22
- - Read the CL description first. Then check that the diff does what the
23
- description says, and nothing else.
13
+ - **Automated Review Agent (diff already in prompt):** Do not run shell
14
+ commands. Use `read_file` to inspect enclosing classes/functions/tests and
15
+ `search_files` to verify callers or conventions across the repository.
16
+ - **Local CLI / Interactive session (no diff in prompt):**
17
+ - **Local change:** `git diff origin/main...HEAD` (or `git show HEAD` for a
18
+ single-commit branch). To learn about the branch and upload workflow, see the
19
+ `devtools-version-control` skill.
20
+ - **Gerrit CL:** strip the leading `)]}'` line from each response to get JSON:
21
+ - Diff: `git cl diff` (for the current branch), or fetch the patch set.
22
+ - Inline comments:
23
+ `curl -s https://chromium-review.googlesource.com/changes/devtools%2Fdevtools-frontend~<CL_NUMBER>/comments | tail -n +2`
24
+ - Messages:
25
+ `.../changes/devtools%2Fdevtools-frontend~<CL_NUMBER>/messages`
26
+ - Read the CL description first. Then check that the diff does what the
27
+ description says, and nothing else.
24
28
 
25
29
  ## 2. Consult the specialized skills
26
30
 
@@ -29,7 +33,7 @@ Load the skill that matches what the diff touches, and apply its rules:
29
33
  | If the diff touches… | Use skill |
30
34
  | :--- | :--- |
31
35
  | Any `import` statement, or a new cross-module dependency | `devtools-imports` |
32
- | `UI.Widget`, lit-html views, components, CSS | `devtools-ui-widgets` |
36
+ | `UI.Widget`, lit-html views, components, CSS | `ui-widgets` |
33
37
  | Migration of legacy imperative DOM to widgets or Lit | `ui-eng-vision-orchestrator` (and its sub-skills) |
34
38
  | New or changed tests: choosing unit, API, or E2E | `devtools-testing-guidance` |
35
39
  | Tests that use `describeWithEnvironment` or `describeWithMockConnection`, or foundation modules | `foundation-test-migration` |
package/AUTHORS CHANGED
@@ -108,6 +108,7 @@ Sergio Avalos <sergio.avalos@gmail.com>
108
108
  Shelley Vohr <shelley.vohr@gmail.com>
109
109
  Simon Siefke <simon.siefke@gmail.com>
110
110
  Stephen Tsoi-A-Sue <stsoiasue@gmail.com>
111
+ Steve Harrison <steve@steveharrison.dev>
111
112
  Sunnylost <sunnylost@gmail.com>
112
113
  Suyoung Jung <tdhitbtd@gmail.com>
113
114
  TaegeonKim <aksen5240@gmail.com>
package/DIR_METADATA CHANGED
@@ -2,3 +2,39 @@ team_email: "devtools-dev@chromium.org"
2
2
  buganizer_public: {
3
3
  component_id: 1457055
4
4
  }
5
+ agentic_review: {
6
+ capability_groups: {
7
+ name: "core-review"
8
+ review_capability_skills: [".agents/skills/code-review/SKILL.md"]
9
+ }
10
+ capability_groups: {
11
+ name: "typescript-and-models"
12
+ path_expression: ["front_end/.*\\.ts", ".*BUILD\\.gn", ".*\\.gni"]
13
+ path_expression_exclusion: [".*\\.test\\.ts"]
14
+ review_capability_skills: [
15
+ ".agents/skills/devtools-imports/SKILL.md",
16
+ ".agents/skills/devtools-model-management/SKILL.md",
17
+ ".agents/skills/devtools-setting-migration/SKILL.md",
18
+ ".agents/skills/devtools-unicode-escaping/SKILL.md",
19
+ ".agents/skills/devtools-ux-writing-refactor/SKILL.md"
20
+ ]
21
+ }
22
+ capability_groups: {
23
+ name: "ui-and-widgets"
24
+ path_expression: ["front_end/(panels|ui)/.*\\.(ts|css)"]
25
+ path_expression_exclusion: [".*\\.test\\.ts"]
26
+ review_capability_skills: [
27
+ ".agents/skills/ui-widgets/SKILL.md",
28
+ ".agents/skills/ui-eng-vision-orchestrator/SKILL.md"
29
+ ]
30
+ }
31
+ capability_groups: {
32
+ name: "tests"
33
+ path_expression: [".*\\.test\\.ts", "test/.*\\.ts"]
34
+ review_capability_skills: [
35
+ ".agents/skills/devtools-testing-guidance/SKILL.md",
36
+ ".agents/skills/foundation-test-migration/SKILL.md",
37
+ ".agents/skills/fix-tests/SKILL.md"
38
+ ]
39
+ }
40
+ }
@@ -19,11 +19,11 @@ const UIStrings = {
19
19
  /**
20
20
  * @description Error message for when a CSS file can't be loaded.
21
21
  */
22
- couldNotFindTheOriginalStyle: 'Could not find the original style sheet',
22
+ couldNotFindTheOriginalStyle: 'Couldn’t find the original style sheet',
23
23
  /**
24
24
  * @description Error message to display when a source CSS file could not be retrieved.
25
25
  */
26
- couldNotRetrieveSourceStyles: 'Could not retrieve source styles',
26
+ couldNotRetrieveSourceStyles: 'Couldn’t retrieve source styles',
27
27
  } as const;
28
28
  const str_ = i18n.i18n.registerUIStrings('core/sdk/CSSStyleSheetHeader.ts', UIStrings);
29
29
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
@@ -15,7 +15,7 @@ const UIStrings = {
15
15
  * @example {https://example.com/sourcemap.map} PH1
16
16
  * @example {An error occurred} PH2
17
17
  */
18
- couldNotLoadContentForSS: 'Could not load content for {PH1} ({PH2})',
18
+ couldNotLoadContentForSS: 'Couldn’t load content for {PH1} ({PH2})',
19
19
  } as const;
20
20
 
21
21
  const str_ = i18n.i18n.registerUIStrings('core/sdk/CompilerSourceMappingContentProvider.ts', UIStrings);
@@ -30,11 +30,11 @@ const UIStrings = {
30
30
  /**
31
31
  * @description Tooltip to explain why a cookie was blocked.
32
32
  */
33
- secureOnly: 'This cookie was blocked because it had the "`Secure`" attribute and the connection was not secure',
33
+ secureOnly: 'This cookie was blocked because it had the "`Secure`" attribute and the connection wasn’t secure',
34
34
  /**
35
35
  * @description Tooltip to explain why a cookie was blocked.
36
36
  */
37
- notOnPath: 'This cookie was blocked because its path was not an exact match for or a superdirectory of the request URL’s path',
37
+ notOnPath: 'This cookie was blocked because its path wasn’t an exact match for or a superdirectory of the request URL’s path',
38
38
  /**
39
39
  * @description Tooltip to explain why a cookie was blocked.
40
40
  */
@@ -46,15 +46,15 @@ const UIStrings = {
46
46
  /**
47
47
  * @description Tooltip to explain why a cookie was blocked.
48
48
  */
49
- sameSiteLax: 'This cookie was blocked because it had the "`SameSite=Lax`" attribute and the request was made from a different site and was not initiated by a top-level navigation',
49
+ sameSiteLax: 'This cookie was blocked because it had the "`SameSite=Lax`" attribute and the request was made from a different site and wasn’t initiated by a top-level navigation',
50
50
  /**
51
51
  * @description Tooltip to explain why a cookie was blocked.
52
52
  */
53
- sameSiteUnspecifiedTreatedAsLax: 'This cookie didn’t specify a "`SameSite`" attribute when it was stored and was defaulted to "`SameSite=Lax`", and was blocked because the request was made from a different site and was not initiated by a top-level navigation. The cookie had to have been set with "`SameSite=None`" to enable cross-site usage.',
53
+ sameSiteUnspecifiedTreatedAsLax: 'This cookie didn’t specify a "`SameSite`" attribute when it was stored and was defaulted to "`SameSite=Lax`", and was blocked because the request was made from a different site and wasn’t initiated by a top-level navigation. The cookie had to have been set with "`SameSite=None`" to enable cross-site usage.',
54
54
  /**
55
55
  * @description Tooltip to explain why a cookie was blocked.
56
56
  */
57
- sameSiteNoneInsecure: 'This cookie was blocked because it had the "`SameSite=None`" attribute but was not marked "`Secure`". Cookies without SameSite restrictions must be marked "`Secure`" and sent over a secure connection.',
57
+ sameSiteNoneInsecure: 'This cookie was blocked because it had the "`SameSite=None`" attribute but wasn’t marked "`Secure`". Cookies without SameSite restrictions must be marked "`Secure`" and sent over a secure connection.',
58
58
  /**
59
59
  * @description Tooltip to explain why a cookie was blocked.
60
60
  */
@@ -90,7 +90,7 @@ const UIStrings = {
90
90
  /**
91
91
  * @description Tooltip to explain why a cookie was blocked.
92
92
  */
93
- theSchemeOfThisConnectionIsNot: 'The scheme of this connection is not allowed to store cookies',
93
+ theSchemeOfThisConnectionIsNot: 'The scheme of this connection isn’t allowed to store cookies',
94
94
  /**
95
95
  * @description Tooltip to explain why a cookie was blocked.
96
96
  */
@@ -98,24 +98,24 @@ const UIStrings = {
98
98
  /**
99
99
  * @description Tooltip to explain why an attempt to set a cookie via a `Set-Cookie` HTTP header on a request's response was blocked.
100
100
  */
101
- blockedReasonSecureOnly: 'This attempt to set a cookie via a "`Set-Cookie`" header was blocked because it had the "`Secure`" attribute but was not received over a secure connection',
101
+ blockedReasonSecureOnly: 'This attempt to set a cookie via a "`Set-Cookie`" header was blocked because it had the "`Secure`" attribute but wasn’t received over a secure connection',
102
102
  /**
103
103
  * @description Tooltip to explain why an attempt to set a cookie via a `Set-Cookie` HTTP header on a request's response was blocked.
104
104
  * @example {SameSite=Strict} PH1
105
105
  */
106
- blockedReasonSameSiteStrictLax: 'This attempt to set a cookie via a "`Set-Cookie`" header was blocked because it had the "{PH1}" attribute but came from a cross-site response which was not the response to a top-level navigation',
106
+ blockedReasonSameSiteStrictLax: 'This attempt to set a cookie via a "`Set-Cookie`" header was blocked because it had the "{PH1}" attribute but came from a cross-site response which wasn’t the response to a top-level navigation',
107
107
  /**
108
108
  * @description Tooltip to explain why an attempt to set a cookie via a `Set-Cookie` HTTP header on a request's response was blocked.
109
109
  */
110
- blockedReasonSameSiteUnspecifiedTreatedAsLax: 'This "`Set-Cookie`" header didn’t specify a "`SameSite`" attribute and was defaulted to "`SameSite=Lax`", and was blocked because it came from a cross-site response which was not the response to a top-level navigation. The "`Set-Cookie`" header had to have been set with "`SameSite=None`" to enable cross-site usage.',
110
+ blockedReasonSameSiteUnspecifiedTreatedAsLax: 'This "`Set-Cookie`" header didn’t specify a "`SameSite`" attribute and was defaulted to "`SameSite=Lax`", and was blocked because it came from a cross-site response which wasn’t the response to a top-level navigation. The "`Set-Cookie`" header had to have been set with "`SameSite=None`" to enable cross-site usage.',
111
111
  /**
112
112
  * @description Tooltip to explain why an attempt to set a cookie via a `Set-Cookie` HTTP header on a request's response was blocked.
113
113
  */
114
- blockedReasonSameSiteNoneInsecure: 'This attempt to set a cookie via a "`Set-Cookie`" header was blocked because it had the "`SameSite=None`" attribute but did not have the "`Secure`" attribute, which is required in order to use "`SameSite=None`"',
114
+ blockedReasonSameSiteNoneInsecure: 'This attempt to set a cookie via a "`Set-Cookie`" header was blocked because it had the "`SameSite=None`" attribute but didn’t have the "`Secure`" attribute, which is required in order to use "`SameSite=None`"',
115
115
  /**
116
116
  * @description Tooltip to explain why an attempt to set a cookie via a `Set-Cookie` HTTP header on a request's response was blocked.
117
117
  */
118
- blockedReasonOverwriteSecure: 'This attempt to set a cookie via a "`Set-Cookie`" header was blocked because it was not sent over a secure connection and would have overwritten a cookie with the "`Secure`" attribute',
118
+ blockedReasonOverwriteSecure: 'This attempt to set a cookie via a "`Set-Cookie`" header was blocked because it wasn’t sent over a secure connection and would have overwritten a cookie with the "`Secure`" attribute',
119
119
  /**
120
120
  * @description Tooltip to explain why an attempt to set a cookie via a `Set-Cookie` HTTP header on a request's response was blocked.
121
121
  */
@@ -291,6 +291,21 @@ export class ResourceTreeModel extends SDKModel<EventTypes> {
291
291
  this.dispatchEventToListeners(Events.FrameNavigatedWithinDocument, frame);
292
292
  }
293
293
 
294
+ frameStoppedLoading(frameId: Protocol.Page.FrameId): void {
295
+ const frame = this.framesInternal.get(frameId);
296
+ if (!frame) {
297
+ return;
298
+ }
299
+ // The renderer sends `Page.frameNavigated` before it tells the browser
300
+ // process about the commit, so the `Storage.getStorageKey` request issued
301
+ // from `ResourceTreeFrame.navigate()` may be answered for the previous
302
+ // document (and fails outright if that document had an opaque origin, e.g.
303
+ // the initial about:blank). `Page.frameStoppedLoading` comes from the
304
+ // browser process after the commit, so re-fetch the storage key here.
305
+ void frame.getStorageKey(/* forceFetch */ true);
306
+ void this.updateStorageKeys();
307
+ }
308
+
294
309
  frameDetached(frameId: Protocol.Page.FrameId, isSwap: boolean): void {
295
310
  // Do nothing unless cached resource tree is processed - it will overwrite everything.
296
311
  if (!this.#cachedResourcesProcessed) {
@@ -1145,7 +1160,8 @@ export class PageDispatcher implements ProtocolProxyApi.PageDispatcher {
1145
1160
  frameStartedLoading({}: Protocol.Page.FrameStartedLoadingEvent): void {
1146
1161
  }
1147
1162
 
1148
- frameStoppedLoading({}: Protocol.Page.FrameStoppedLoadingEvent): void {
1163
+ frameStoppedLoading({frameId}: Protocol.Page.FrameStoppedLoadingEvent): void {
1164
+ this.#resourceTreeModel.frameStoppedLoading(frameId);
1149
1165
  }
1150
1166
 
1151
1167
  frameRequestedNavigation({}: Protocol.Page.FrameRequestedNavigationEvent): void {
@@ -905,6 +905,12 @@ export class SourceMap {
905
905
  return this.hasEncodedScopeInfo() && (this.#scopesInfo?.hasOutlinedFunctions() ?? false);
906
906
  }
907
907
 
908
+ /** See {@link SourceMapScopesInfo.outlinedFunctionRanges}. Empty without encoded scopes. */
909
+ outlinedFunctionRanges(generatedLine: number, generatedColumn: number): PositionRange[] {
910
+ return this.hasEncodedScopeInfo() ? this.#scopesInfo?.outlinedFunctionRanges(generatedLine, generatedColumn) ?? [] :
911
+ [];
912
+ }
913
+
908
914
  /** See {@link SourceMapScopesInfo.artificialFunctionRanges}. Empty without encoded scopes. */
909
915
  artificialFunctionRanges(): PositionRange[] {
910
916
  return this.hasEncodedScopeInfo() ? this.#scopesInfo?.artificialFunctionRanges() ?? [] : [];
@@ -624,6 +624,31 @@ export class SourceMapScopesInfo {
624
624
  return hasOutlined(this.#generatedRanges);
625
625
  }
626
626
 
627
+ /**
628
+ * @returns the outlined parts of the authored function at the position: the hidden generated functions whose
629
+ * original scope lies within that function's original scope (see {@link GeneratedFrameKind.OUTLINED}).
630
+ * Includes the outlined part the position itself is in, if any. Sorted by start position.
631
+ */
632
+ outlinedFunctionRanges(generatedLine: number, generatedColumn: number): PositionRange[] {
633
+ const rangeChain = this.#findGeneratedRangeChain(generatedLine, generatedColumn);
634
+ const functionScope = this.#findFunctionScopeInOriginalScopeChain(rangeChain.at(-1)?.originalScope);
635
+ if (!functionScope) {
636
+ return [];
637
+ }
638
+ const isWithinFunction = (scope: ScopesCodec.OriginalScope|undefined): boolean =>
639
+ scope !== undefined && (scope === functionScope || isWithinFunction(scope.parent));
640
+ const result: PositionRange[] = [];
641
+ (function walk(ranges: ScopesCodec.GeneratedRange[]) {
642
+ for (const range of ranges) {
643
+ if (range.isStackFrame && range.isHidden && isWithinFunction(range.originalScope)) {
644
+ result.push({start: range.start, end: range.end});
645
+ }
646
+ walk(range.children);
647
+ }
648
+ })(this.#generatedRanges);
649
+ return result;
650
+ }
651
+
627
652
  /**
628
653
  * @returns the "artificial" generated functions (in the DWARF sense): functions that contain no authored code at all
629
654
  * (no original scope anywhere in their subtree), e.g. compiler helpers. Sorted by start position,
@@ -39,7 +39,7 @@ const UIStrings = {
39
39
  /**
40
40
  * @description Title of an option under the Rendering category that can be invoked through the Command Menu.
41
41
  */
42
- doNotHighlightAdFrames: 'Do not highlight ad frames',
42
+ doNotHighlightAdFrames: 'Don’t highlight ad frames',
43
43
  /**
44
44
  * @description Title of an option under the Rendering category that can be invoked through the Command Menu.
45
45
  */
@@ -71,11 +71,11 @@ const UIStrings = {
71
71
  /**
72
72
  * @description Title of a Rendering setting that can be invoked through the Command Menu.
73
73
  */
74
- doNotEmulateAFocusedPage: 'Do not emulate a focused page',
74
+ doNotEmulateAFocusedPage: 'Don’t emulate a focused page',
75
75
  /**
76
76
  * @description Title of a setting under the Rendering category that can be invoked through the Command Menu.
77
77
  */
78
- doNotEmulateCssMediaType: 'Do not emulate CSS media type',
78
+ doNotEmulateCssMediaType: 'Don’t emulate CSS media type',
79
79
  /**
80
80
  * @description A drop-down menu option to do not emulate css media type.
81
81
  */
@@ -108,7 +108,7 @@ const UIStrings = {
108
108
  * @description Title of a setting under the Rendering drawer that can be invoked through the Command Menu.
109
109
  * @example {prefers-color-scheme} PH1
110
110
  */
111
- doNotEmulateCss: 'Do not emulate CSS {PH1}',
111
+ doNotEmulateCss: 'Don’t emulate CSS {PH1}',
112
112
  /**
113
113
  * @description Title of a setting under the Rendering drawer that can be invoked through the Command Menu.
114
114
  * @example {prefers-color-scheme: light} PH1
@@ -172,7 +172,7 @@ const UIStrings = {
172
172
  /**
173
173
  * @description Title of a setting under the Rendering drawer that can be invoked through the Command Menu.
174
174
  */
175
- doNotEmulateAnyVisionDeficiency: 'Do not emulate any vision deficiency',
175
+ doNotEmulateAnyVisionDeficiency: 'Don’t emulate any vision deficiency',
176
176
  /**
177
177
  * @description Title of a setting under the Rendering drawer that can be invoked through the Command Menu.
178
178
  */
@@ -232,7 +232,7 @@ const UIStrings = {
232
232
  /**
233
233
  * @description Title of a setting under the Rendering category that can be invoked through the Command Menu.
234
234
  */
235
- doNotEmulateOsTextScale: 'Do not emulate OS text scale',
235
+ doNotEmulateOsTextScale: 'Don’t emulate OS text scale',
236
236
  /**
237
237
  * @description A drop-down menu option to not emulate OS text scale.
238
238
  */
@@ -340,7 +340,7 @@ const UIStrings = {
340
340
  * @description A command available in the command menu to stop automatically opening DevTools when
341
341
  * webpages create new popup windows.
342
342
  */
343
- doNotAutoOpen: 'Do not auto-open DevTools for popups',
343
+ doNotAutoOpen: 'Don’t auto-open DevTools for popups',
344
344
  /**
345
345
  * @description Title of an action that toggles the "forces CSS prefers-color-scheme" media feature.
346
346
  */
@@ -1567,7 +1567,7 @@ inspectorBackend.registerCommand("Debugger.setSkipAllPauses", [{"name": "skip",
1567
1567
  inspectorBackend.registerCommand("Debugger.setVariableValue", [{"name": "scopeNumber", "type": "number", "optional": false, "description": "0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch' scope types are allowed. Other scopes could be manipulated manually.", "typeRef": null}, {"name": "variableName", "type": "string", "optional": false, "description": "Variable name.", "typeRef": null}, {"name": "newValue", "type": "object", "optional": false, "description": "New variable value.", "typeRef": "Runtime.CallArgument"}, {"name": "callFrameId", "type": "string", "optional": false, "description": "Id of callframe that holds variable.", "typeRef": "Debugger.CallFrameId"}], [], "Changes value of variable in a callframe. Object-based scopes are not supported and must be mutated manually.");
1568
1568
  inspectorBackend.registerCommand("Debugger.stepInto", [{"name": "breakOnAsyncCall", "type": "boolean", "optional": true, "description": "Debugger will pause on the execution of the first async task which was scheduled before next pause.", "typeRef": null}, {"name": "skipList", "type": "array", "optional": true, "description": "The skipList specifies location ranges that should be skipped on step into.", "typeRef": "Debugger.LocationRange"}], [], "Steps into the function call.");
1569
1569
  inspectorBackend.registerCommand("Debugger.stepOut", [], [], "Steps out of the function call.");
1570
- inspectorBackend.registerCommand("Debugger.stepOver", [{"name": "skipList", "type": "array", "optional": true, "description": "The skipList specifies location ranges that should be skipped on step over.", "typeRef": "Debugger.LocationRange"}], [], "Steps over the statement.");
1570
+ inspectorBackend.registerCommand("Debugger.stepOver", [{"name": "skipList", "type": "array", "optional": true, "description": "The skipList specifies location ranges that should be skipped on step over.", "typeRef": "Debugger.LocationRange"}, {"name": "enterRanges", "type": "array", "optional": true, "description": "Functions whose source range lies within one of the enterRanges are entered as if by stepInto, even when they are called (directly or indirectly) from a call that is stepped over.", "typeRef": "Debugger.LocationRange"}], [], "Steps over the statement.");
1571
1571
  inspectorBackend.registerType("Debugger.Location", [{"name": "scriptId", "type": "string", "optional": false, "description": "Script identifier as reported in the `Debugger.scriptParsed`.", "typeRef": "Runtime.ScriptId"}, {"name": "lineNumber", "type": "number", "optional": false, "description": "Line number in the script (0-based).", "typeRef": null}, {"name": "columnNumber", "type": "number", "optional": true, "description": "Column number in the script (0-based).", "typeRef": null}]);
1572
1572
  inspectorBackend.registerType("Debugger.ScriptPosition", [{"name": "lineNumber", "type": "number", "optional": false, "description": "", "typeRef": null}, {"name": "columnNumber", "type": "number", "optional": false, "description": "", "typeRef": null}]);
1573
1573
  inspectorBackend.registerType("Debugger.LocationRange", [{"name": "scriptId", "type": "string", "optional": false, "description": "", "typeRef": "Runtime.ScriptId"}, {"name": "start", "type": "object", "optional": false, "description": "", "typeRef": "Debugger.ScriptPosition"}, {"name": "end", "type": "object", "optional": false, "description": "", "typeRef": "Debugger.ScriptPosition"}]);
@@ -21405,6 +21405,12 @@ export namespace Debugger {
21405
21405
  * The skipList specifies location ranges that should be skipped on step over.
21406
21406
  */
21407
21407
  skipList?: LocationRange[];
21408
+ /**
21409
+ * Functions whose source range lies within one of the enterRanges are
21410
+ * entered as if by stepInto, even when they are called (directly or
21411
+ * indirectly) from a call that is stepped over.
21412
+ */
21413
+ enterRanges?: LocationRange[];
21408
21414
  }
21409
21415
 
21410
21416
  /**
@@ -7,6 +7,10 @@
7
7
  *
8
8
  * Mirrors the Wasm auto-stepping: user steps get a skip list (see `DebuggerWorkspaceBinding.computeAutoStep`), and
9
9
  * pauses that don't correspond to a "logical" step are continued automatically ({@link nextAutoStep}).
10
+ *
11
+ * Outlined code is code of an authored function that the compiler moved into a separate generated function marked as
12
+ * "hidden". A run of outlined frames on top of the stack is one logical frame together with the frame below them (the
13
+ * "owner"), see {@link logicalDepth}.
10
14
  */
11
15
 
12
16
  import * as Root from '../../core/root/root.js';
@@ -51,6 +55,29 @@ export function isScopedFrame(frame: SDK.DebuggerModel.CallFrame): boolean {
51
55
  return scopedPosition(frame) !== null;
52
56
  }
53
57
 
58
+ /** @returns the number of leading frames that are outlined parts of the (logical) frame below them. */
59
+ function outlinedPrefixLength(callFrames: readonly SDK.DebuggerModel.CallFrame[]): number {
60
+ let length = 0;
61
+ for (const frame of callFrames) {
62
+ const position = scopedPosition(frame);
63
+ if (!position ||
64
+ position.sourceMap.translateRawFrame(position.line, position.column)?.kind !==
65
+ SDK.SourceMapScopesInfo.GeneratedFrameKind.OUTLINED) {
66
+ break;
67
+ }
68
+ ++length;
69
+ }
70
+ return length;
71
+ }
72
+
73
+ /**
74
+ * @returns the stack depth that doesn't count outlined frames on top of the stack. Entering or leaving an outlined
75
+ * part of a function doesn't change it, while calling a function increases it.
76
+ */
77
+ export function logicalDepth(callFrames: readonly SDK.DebuggerModel.CallFrame[]): number {
78
+ return callFrames.length - outlinedPrefixLength(callFrames);
79
+ }
80
+
54
81
  /** @returns true iff {@link frame} has encoded scopes, and its position is not mapped to any source. */
55
82
  export function isUnmapped(frame: SDK.DebuggerModel.CallFrame): boolean {
56
83
  const position = scopedPosition(frame);
@@ -105,8 +132,8 @@ export async function nextAutoStep(
105
132
  return isUnmapped(frames[0]) ? await computeAutoStep(SDK.DebuggerModel.StepMode.STEP_INTO, frames) : null;
106
133
 
107
134
  case SDK.DebuggerModel.StepMode.STEP_OVER: {
108
- const startDepth = start.length;
109
- const depth = frames.length;
135
+ const startDepth = logicalDepth(start);
136
+ const depth = logicalDepth(frames);
110
137
  if (isUnmapped(frames[0]) || (depth === startDepth && isSameOriginalLocation(frames[0], start[0]))) {
111
138
  // Unmapped code, or still on the same original location (the skip list only covers the generated ranges that
112
139
  // contain the start position): keep stepping over.
@@ -27,7 +27,7 @@ const UIStrings = {
27
27
  /**
28
28
  * @description A description for a kind of issue we display in the Issues tab.
29
29
  */
30
- pageErrorIssue: 'A page error issue: the page is not working correctly',
30
+ pageErrorIssue: 'A page error issue: the page isn’t working correctly',
31
31
  /**
32
32
  * @description A description for a kind of issue we display in the Issues tab.
33
33
  */
@@ -227,7 +227,7 @@ export const NativeFunctions: readonly NativeFunctionValue[] = [
227
227
  {
228
228
  name: "create",
229
229
  signatures: [["?options"]],
230
- receivers: ["CredentialsContainer","SemanticEmbedder"]
230
+ receivers: ["CredentialsContainer","DecisionModel","SemanticEmbedder"]
231
231
  },
232
232
  {
233
233
  name: "defineProperty",
@@ -8089,6 +8089,10 @@ export const NativeFunctions: readonly NativeFunctionValue[] = [
8089
8089
  name: "decapsulateBits",
8090
8090
  signatures: [["decapsulationAlgorithm","decapsulationKey","ciphertext"]]
8091
8091
  },
8092
+ {
8093
+ name: "requestFileHandle",
8094
+ signatures: [["hash","?options"]]
8095
+ },
8092
8096
  {
8093
8097
  name: "userAgentAllowsProtocol",
8094
8098
  signatures: [["protocol"]]
@@ -8305,6 +8309,14 @@ export const NativeFunctions: readonly NativeFunctionValue[] = [
8305
8309
  name: "WorkletAnimation",
8306
8310
  signatures: [["animatorName","effects","?timeline","?options"]]
8307
8311
  },
8312
+ {
8313
+ name: "availability",
8314
+ signatures: [["?options"]]
8315
+ },
8316
+ {
8317
+ name: "decide",
8318
+ signatures: [["input","?options"]]
8319
+ },
8308
8320
  {
8309
8321
  name: "LanguageModelToolCall",
8310
8322
  signatures: [["init"]]
@@ -8317,10 +8329,6 @@ export const NativeFunctions: readonly NativeFunctionValue[] = [
8317
8329
  name: "LanguageModelToolError",
8318
8330
  signatures: [["init"]]
8319
8331
  },
8320
- {
8321
- name: "availability",
8322
- signatures: [["?options"]]
8323
- },
8324
8332
  {
8325
8333
  name: "embed",
8326
8334
  signatures: [["input","?options"]]
@@ -8399,7 +8407,7 @@ export const NativeFunctions: readonly NativeFunctionValue[] = [
8399
8407
  },
8400
8408
  {
8401
8409
  name: "createParserOptions",
8402
- signatures: [["input"]]
8410
+ signatures: [["?input","...args"]]
8403
8411
  },
8404
8412
  {
8405
8413
  name: "createPolicy",
@@ -202,6 +202,13 @@ export class TraceProcessor extends EventTarget {
202
202
 
203
203
  options.logger?.start('parse:handleEvent');
204
204
 
205
+ // In bundled builds each handler is a module namespace object whose exports are getters, and every handler has a
206
+ // different shape. V8 can't optimise a `handler.handleEvent` read that sees all these shapes, so reading it inside the
207
+ // loop costs a slow getter call for every event and handler.
208
+ // On a 1M-event trace that is about 30M getter calls per parse. Reading each `handleEvent` once here cut the
209
+ // handleEvent loop from ~2.9s to ~2.1s (-25%) and total parse time by ~10%, so keep this read outside the loop.
210
+ const handleEventFns = sortedHandlers.map(([, handler]) => handler.handleEvent);
211
+
205
212
  // Handle each event.
206
213
  for (let i = 0; i < traceEvents.length; ++i) {
207
214
  // Every so often we take a break just to render.
@@ -213,9 +220,8 @@ export class TraceProcessor extends EventTarget {
213
220
  await new Promise(resolve => setTimeout(resolve, 0));
214
221
  }
215
222
  const event = traceEvents[i];
216
- for (let j = 0; j < sortedHandlers.length; ++j) {
217
- const [, handler] = sortedHandlers[j];
218
- handler.handleEvent(event);
223
+ for (let j = 0; j < handleEventFns.length; ++j) {
224
+ handleEventFns[j](event);
219
225
  }
220
226
  }
221
227
 
@@ -497,7 +497,7 @@ export class BottomUpRootNode extends Node {
497
497
 
498
498
  function onEndEvent(event: Types.Events.Event): void {
499
499
  const id = idStack.pop();
500
- if (!id) {
500
+ if (id === undefined) {
501
501
  return;
502
502
  }
503
503
 
@@ -68,7 +68,7 @@ export const UIStrings = {
68
68
  /**
69
69
  * @description Text status when no layout shift culprits or root causes were found.
70
70
  */
71
- noCulprits: 'Could not detect any layout shift culprits',
71
+ noCulprits: 'Couldn’t detect any layout shift culprits',
72
72
  } as const;
73
73
 
74
74
  const str_ = i18n.i18n.registerUIStrings('models/trace/insights/CLSCulprits.ts', UIStrings);
@@ -4,6 +4,7 @@
4
4
 
5
5
  import '../../ui/legacy/components/data_grid/data_grid.js';
6
6
 
7
+ import * as Common from '../../core/common/common.js';
7
8
  import * as Host from '../../core/host/host.js';
8
9
  import * as i18n from '../../core/i18n/i18n.js';
9
10
  import * as UI from '../../ui/legacy/legacy.js';
@@ -54,6 +55,14 @@ const UIStrings = {
54
55
  * @description Context menu item for copying the announcement element HTML snippet to the clipboard.
55
56
  */
56
57
  copyElementHtml: 'Copy element HTML',
58
+ /**
59
+ * @description Context menu item to reveal the announcement source element in the Elements panel DOM tree.
60
+ */
61
+ revealInElements: 'Reveal in Elements panel',
62
+ /**
63
+ * @description Context menu item to reveal the announcement source element in the full Accessibility tree.
64
+ */
65
+ revealInA11yTree: 'Reveal in Accessibility tree',
57
66
  } as const;
58
67
  const str_ =
59
68
  i18n.i18n.registerUIStrings('panels/accessibility/AccessibilityAnnouncementRecordingListView.ts', UIStrings);
@@ -124,10 +133,13 @@ export const DEFAULT_VIEW: View = (input, _output, target) => {
124
133
  // clang-format on
125
134
  };
126
135
 
127
- export class AccessibilityAnnouncementRecordingListView extends UI.Widget.VBox {
136
+ const AccessibilityAnnouncementRecordingListViewBase:
137
+ Common.ObjectWrapper.EventMixin<AccessibilityAnnouncementRecordingListView.EventTypes, typeof UI.Widget.VBox> =
138
+ Common.ObjectWrapper.eventMixin(UI.Widget.VBox);
139
+
140
+ export class AccessibilityAnnouncementRecordingListView extends AccessibilityAnnouncementRecordingListViewBase {
128
141
  #items: readonly A11yAnnouncement[] = [];
129
142
  #selectedItem: A11yAnnouncement|null = null;
130
- #onSelect: ((item: A11yAnnouncement|null) => void)|null = null;
131
143
  readonly #view: View;
132
144
 
133
145
  constructor(element?: HTMLElement, view: View = DEFAULT_VIEW) {
@@ -164,10 +176,6 @@ export class AccessibilityAnnouncementRecordingListView extends UI.Widget.VBox {
164
176
  return this.#selectedItem;
165
177
  }
166
178
 
167
- set onSelect(onSelect: (item: A11yAnnouncement|null) => void) {
168
- this.#onSelect = onSelect;
169
- }
170
-
171
179
  reset(): void {
172
180
  this.#items = [];
173
181
  this.#selectedItem = null;
@@ -175,6 +183,16 @@ export class AccessibilityAnnouncementRecordingListView extends UI.Widget.VBox {
175
183
  }
176
184
 
177
185
  #populateContextMenu(contextMenu: UI.ContextMenu.ContextMenu, item: A11yAnnouncement): void {
186
+ if (item.element) {
187
+ const revealSection = contextMenu.revealSection();
188
+ revealSection.appendItem(i18nString(UIStrings.revealInElements), () => {
189
+ this.dispatchEventToListeners(AccessibilityAnnouncementRecordingListView.Events.REVEAL_IN_ELEMENTS, item);
190
+ }, {jslogContext: 'reveal-in-elements'});
191
+ revealSection.appendItem(i18nString(UIStrings.revealInA11yTree), () => {
192
+ this.dispatchEventToListeners(AccessibilityAnnouncementRecordingListView.Events.REVEAL_IN_A11Y_TREE, item);
193
+ }, {jslogContext: 'reveal-in-a11y-tree'});
194
+ }
195
+
178
196
  if (item.message) {
179
197
  contextMenu.clipboardSection().appendItem(i18nString(UIStrings.copyMessage), () => {
180
198
  Host.InspectorFrontendHost.InspectorFrontendHostInstance.copyText(item.message);
@@ -197,13 +215,27 @@ export class AccessibilityAnnouncementRecordingListView extends UI.Widget.VBox {
197
215
  },
198
216
  onSelect: (item: A11yAnnouncement) => {
199
217
  this.selectedItem = item;
200
- this.#onSelect?.(item);
218
+ this.dispatchEventToListeners(AccessibilityAnnouncementRecordingListView.Events.ANNOUNCEMENT_SELECTED, item);
201
219
  },
202
220
  onDeselect: () => {
203
221
  this.selectedItem = null;
204
- this.#onSelect?.(null);
222
+ this.dispatchEventToListeners(AccessibilityAnnouncementRecordingListView.Events.ANNOUNCEMENT_SELECTED, null);
205
223
  },
206
224
  };
207
225
  this.#view(input, undefined, this.contentElement);
208
226
  }
209
227
  }
228
+
229
+ export namespace AccessibilityAnnouncementRecordingListView {
230
+ export const enum Events {
231
+ ANNOUNCEMENT_SELECTED = 'announcement-selected',
232
+ REVEAL_IN_ELEMENTS = 'reveal-in-elements',
233
+ REVEAL_IN_A11Y_TREE = 'reveal-in-a11y-tree',
234
+ }
235
+
236
+ export interface EventTypes {
237
+ [Events.ANNOUNCEMENT_SELECTED]: A11yAnnouncement|null;
238
+ [Events.REVEAL_IN_ELEMENTS]: A11yAnnouncement;
239
+ [Events.REVEAL_IN_A11Y_TREE]: A11yAnnouncement;
240
+ }
241
+ }