chrome-devtools-frontend 1.0.943986 → 1.0.945579
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/config/gni/devtools_grd_files.gni +4 -0
- package/config/gni/devtools_image_files.gni +1 -0
- package/front_end/Images/src/circled_exclamation_icon.svg +3 -0
- package/front_end/core/common/ParsedURL.ts +1 -1
- package/front_end/core/host/UserMetrics.ts +2 -1
- package/front_end/core/i18n/i18nImpl.ts +7 -4
- package/front_end/core/i18n/locales/en-US.json +3 -72
- package/front_end/core/i18n/locales/en-XL.json +15 -84
- package/front_end/core/protocol_client/NodeURL.ts +1 -0
- package/front_end/core/sdk/CSSMetadata.ts +0 -1
- package/front_end/core/sdk/CSSStyleDeclaration.ts +4 -0
- package/front_end/core/sdk/CSSStyleSheetHeader.ts +2 -3
- package/front_end/core/sdk/CompilerSourceMappingContentProvider.ts +2 -3
- package/front_end/core/sdk/Cookie.ts +17 -0
- package/front_end/core/sdk/CookieModel.ts +1 -0
- package/front_end/core/sdk/DebuggerModel.ts +5 -4
- package/front_end/core/sdk/NetworkManager.ts +4 -1
- package/front_end/core/sdk/NetworkRequest.ts +2 -2
- package/front_end/core/sdk/OverlayModel.ts +0 -9
- package/front_end/core/sdk/Resource.ts +2 -2
- package/front_end/core/sdk/Script.ts +2 -3
- package/front_end/core/sdk/sdk-meta.ts +0 -26
- package/front_end/entrypoints/inspector_main/RenderingOptions.ts +0 -13
- package/front_end/entrypoints/main/MainImpl.ts +4 -0
- package/front_end/generated/protocol.d.ts +0 -4
- package/front_end/models/bindings/BreakpointManager.ts +3 -4
- package/front_end/models/bindings/ResourceMapping.ts +1 -2
- package/front_end/models/bindings/StylesSourceMapping.ts +1 -2
- package/front_end/models/emulation/EmulatedDevices.ts +2 -4
- package/front_end/models/persistence/IsolatedFileSystem.ts +7 -6
- package/front_end/models/persistence/PersistenceActions.ts +4 -1
- package/front_end/models/persistence/PlatformFileSystem.ts +3 -4
- package/front_end/models/text_utils/ContentProvider.ts +1 -2
- package/front_end/models/text_utils/StaticContentProvider.ts +2 -3
- package/front_end/models/workspace/UISourceCode.ts +2 -2
- package/front_end/models/workspace_diff/WorkspaceDiff.ts +20 -6
- package/front_end/panels/animation/animationTimeline.css +2 -0
- package/front_end/panels/application/BackForwardCacheStrings.ts +15 -75
- package/front_end/panels/application/BackForwardCacheView.ts +8 -1
- package/front_end/panels/application/ReportingApiView.ts +15 -1
- package/front_end/panels/application/components/EndpointsGrid.ts +63 -4
- package/front_end/panels/application/components/FrameDetailsView.ts +21 -34
- package/front_end/panels/changes/ChangesView.ts +8 -7
- package/front_end/panels/console/ConsolePinPane.ts +1 -0
- package/front_end/panels/console/ConsolePrompt.ts +121 -171
- package/front_end/panels/console/ConsoleView.ts +1 -1
- package/front_end/panels/console/consoleView.css +1 -1
- package/front_end/panels/css_overview/cssOverviewCompletedView.css +2 -2
- package/front_end/panels/elements/AccessibilityTreeUtils.ts +2 -1
- package/front_end/panels/elements/ElementsTreeElement.ts +1 -0
- package/front_end/panels/elements/StyleEditorWidget.ts +13 -2
- package/front_end/panels/elements/StylePropertyHighlighter.ts +29 -19
- package/front_end/panels/elements/StylePropertyTreeElement.ts +8 -12
- package/front_end/panels/elements/StylesSidebarPane.ts +36 -10
- package/front_end/panels/elements/components/AccessibilityTreeNode.ts +27 -3
- package/front_end/panels/emulation/DeviceModeView.ts +3 -0
- package/front_end/panels/help/ReleaseNoteText.ts +3 -1
- package/front_end/panels/network/NetworkDataGridNode.ts +5 -1
- package/front_end/panels/snippets/ScriptSnippetFileSystem.ts +1 -1
- package/front_end/panels/sources/BreakpointEditDialog.ts +1 -0
- package/front_end/panels/sources/DebuggerPlugin.ts +1 -1
- package/front_end/panels/sources/NavigatorView.ts +1 -1
- package/front_end/panels/sources/UISourceCodeFrame.ts +0 -1
- package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +3 -34
- package/front_end/panels/timeline/TimelineUIUtils.ts +51 -3
- package/front_end/services/window_bounds/WindowBoundsService.ts +27 -0
- package/front_end/services/window_bounds/window_bounds.ts +9 -0
- package/front_end/third_party/acorn/README.chromium +2 -2
- package/front_end/third_party/acorn/acorn.ts +1 -1
- package/front_end/third_party/acorn/package/CHANGELOG.md +31 -1
- package/front_end/third_party/acorn/package/README.md +1 -1
- package/front_end/third_party/acorn/package/dist/acorn.d.ts +3 -0
- package/front_end/third_party/acorn/package/dist/acorn.js +772 -708
- package/front_end/third_party/acorn/package/dist/acorn.mjs +767 -703
- package/front_end/third_party/acorn/package/dist/bin.js +47 -21
- package/front_end/third_party/acorn/package/package.json +1 -1
- package/front_end/third_party/acorn-loose/README.chromium +2 -2
- package/front_end/third_party/acorn-loose/package/CHANGELOG.md +12 -0
- package/front_end/third_party/acorn-loose/package/dist/acorn-loose.js +27 -7
- package/front_end/third_party/acorn-loose/package/dist/acorn-loose.mjs +28 -8
- package/front_end/third_party/acorn-loose/package/package.json +2 -2
- package/front_end/third_party/codemirror.next/bundle.ts +4 -3
- package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
- package/front_end/third_party/codemirror.next/codemirror.next.d.ts +39 -1
- package/front_end/third_party/codemirror.next/codemirror.next.js +1 -1
- package/front_end/third_party/codemirror.next/package.json +4 -4
- package/front_end/third_party/i18n/i18n-impl.ts +1 -1
- package/front_end/third_party/lit-html/README.chromium +2 -2
- package/front_end/third_party/lit-html/package/CHANGELOG.md +216 -28
- package/front_end/third_party/lit-html/package/LICENSE +9 -9
- package/front_end/third_party/lit-html/package/README.md +12 -162
- package/front_end/third_party/lit-html/package/async-directive.d.ts +23 -54
- package/front_end/third_party/lit-html/package/async-directive.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/async-directive.js +2 -7
- package/front_end/third_party/lit-html/package/async-directive.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/async-directive.d.ts +23 -54
- package/front_end/third_party/lit-html/package/development/async-directive.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/async-directive.js +44 -194
- package/front_end/third_party/lit-html/package/development/async-directive.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/directive-helpers.d.ts +6 -5
- package/front_end/third_party/lit-html/package/development/directive-helpers.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/directive-helpers.js +25 -9
- package/front_end/third_party/lit-html/package/development/directive-helpers.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/directive.d.ts +3 -16
- package/front_end/third_party/lit-html/package/development/directive.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/directive.js +6 -1
- package/front_end/third_party/lit-html/package/development/directive.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/async-append.d.ts +7 -14
- package/front_end/third_party/lit-html/package/development/directives/async-append.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/async-append.js +17 -58
- package/front_end/third_party/lit-html/package/development/directives/async-append.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/async-replace.d.ts +9 -14
- package/front_end/third_party/lit-html/package/development/directives/async-replace.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/async-replace.js +57 -37
- package/front_end/third_party/lit-html/package/development/directives/async-replace.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/cache.d.ts +2 -3
- package/front_end/third_party/lit-html/package/development/directives/cache.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/cache.js +4 -6
- package/front_end/third_party/lit-html/package/development/directives/cache.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/class-map.d.ts +2 -2
- package/front_end/third_party/lit-html/package/development/directives/class-map.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/class-map.js +17 -7
- package/front_end/third_party/lit-html/package/development/directives/class-map.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/guard.d.ts +3 -2
- package/front_end/third_party/lit-html/package/development/directives/guard.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/guard.js +3 -2
- package/front_end/third_party/lit-html/package/development/directives/guard.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/live.d.ts +4 -3
- package/front_end/third_party/lit-html/package/development/directives/live.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/live.js +5 -7
- package/front_end/third_party/lit-html/package/development/directives/live.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/private-async-helpers.d.ts +58 -0
- package/front_end/third_party/lit-html/package/development/directives/private-async-helpers.d.ts.map +1 -0
- package/front_end/third_party/lit-html/package/development/directives/private-async-helpers.js +85 -0
- package/front_end/third_party/lit-html/package/development/directives/private-async-helpers.js.map +1 -0
- package/front_end/third_party/lit-html/package/development/directives/ref.d.ts +14 -11
- package/front_end/third_party/lit-html/package/development/directives/ref.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/ref.js +13 -11
- package/front_end/third_party/lit-html/package/development/directives/ref.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/repeat.d.ts +8 -4
- package/front_end/third_party/lit-html/package/development/directives/repeat.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/repeat.js +23 -9
- package/front_end/third_party/lit-html/package/development/directives/repeat.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/style-map.d.ts +1 -2
- package/front_end/third_party/lit-html/package/development/directives/style-map.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/style-map.js +1 -2
- package/front_end/third_party/lit-html/package/development/directives/style-map.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/template-content.d.ts +1 -2
- package/front_end/third_party/lit-html/package/development/directives/template-content.js +1 -2
- package/front_end/third_party/lit-html/package/development/directives/unsafe-html.d.ts +6 -4
- package/front_end/third_party/lit-html/package/development/directives/unsafe-html.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/unsafe-html.js +7 -5
- package/front_end/third_party/lit-html/package/development/directives/unsafe-html.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/unsafe-svg.d.ts +4 -1
- package/front_end/third_party/lit-html/package/development/directives/unsafe-svg.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/unsafe-svg.js +3 -0
- package/front_end/third_party/lit-html/package/development/directives/unsafe-svg.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/until.d.ts +12 -8
- package/front_end/third_party/lit-html/package/development/directives/until.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/until.js +63 -23
- package/front_end/third_party/lit-html/package/development/directives/until.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/experimental-hydrate.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/experimental-hydrate.js +9 -8
- package/front_end/third_party/lit-html/package/development/experimental-hydrate.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/lit-html.d.ts +81 -136
- package/front_end/third_party/lit-html/package/development/lit-html.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/lit-html.js +249 -76
- package/front_end/third_party/lit-html/package/development/lit-html.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/polyfill-support.d.ts +1 -41
- package/front_end/third_party/lit-html/package/development/polyfill-support.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/polyfill-support.js +40 -21
- package/front_end/third_party/lit-html/package/development/polyfill-support.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/private-ssr-support.d.ts +12 -10
- package/front_end/third_party/lit-html/package/development/private-ssr-support.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/private-ssr-support.js +11 -3
- package/front_end/third_party/lit-html/package/development/private-ssr-support.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/static.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/static.js +6 -5
- package/front_end/third_party/lit-html/package/development/static.js.map +1 -1
- package/front_end/third_party/lit-html/package/directive-helpers.d.ts +6 -5
- package/front_end/third_party/lit-html/package/directive-helpers.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/directive-helpers.js +2 -2
- package/front_end/third_party/lit-html/package/directive-helpers.js.map +1 -1
- package/front_end/third_party/lit-html/package/directive.d.ts +3 -16
- package/front_end/third_party/lit-html/package/directive.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/directive.js +1 -1
- package/front_end/third_party/lit-html/package/directive.js.map +1 -1
- package/front_end/third_party/lit-html/package/directives/async-append.d.ts +7 -14
- package/front_end/third_party/lit-html/package/directives/async-append.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/directives/async-append.js +2 -6
- package/front_end/third_party/lit-html/package/directives/async-append.js.map +1 -1
- package/front_end/third_party/lit-html/package/directives/async-replace.d.ts +9 -14
- package/front_end/third_party/lit-html/package/directives/async-replace.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/directives/async-replace.js +2 -5
- package/front_end/third_party/lit-html/package/directives/async-replace.js.map +1 -1
- package/front_end/third_party/lit-html/package/directives/cache.d.ts +2 -3
- package/front_end/third_party/lit-html/package/directives/cache.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/directives/cache.js +2 -5
- package/front_end/third_party/lit-html/package/directives/cache.js.map +1 -1
- package/front_end/third_party/lit-html/package/directives/class-map.d.ts +2 -2
- package/front_end/third_party/lit-html/package/directives/class-map.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/directives/class-map.js +2 -4
- package/front_end/third_party/lit-html/package/directives/class-map.js.map +1 -1
- package/front_end/third_party/lit-html/package/directives/guard.d.ts +3 -2
- package/front_end/third_party/lit-html/package/directives/guard.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/directives/guard.js +2 -4
- package/front_end/third_party/lit-html/package/directives/guard.js.map +1 -1
- package/front_end/third_party/lit-html/package/directives/live.d.ts +4 -3
- package/front_end/third_party/lit-html/package/directives/live.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/directives/live.js +1 -4
- package/front_end/third_party/lit-html/package/directives/live.js.map +1 -1
- package/front_end/third_party/lit-html/package/directives/private-async-helpers.d.ts +58 -0
- package/front_end/third_party/lit-html/package/directives/private-async-helpers.d.ts.map +1 -0
- package/front_end/third_party/lit-html/package/directives/private-async-helpers.js +7 -0
- package/front_end/third_party/lit-html/package/directives/private-async-helpers.js.map +1 -0
- package/front_end/third_party/lit-html/package/directives/ref.d.ts +14 -11
- package/front_end/third_party/lit-html/package/directives/ref.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/directives/ref.js +2 -5
- package/front_end/third_party/lit-html/package/directives/ref.js.map +1 -1
- package/front_end/third_party/lit-html/package/directives/repeat.d.ts +8 -4
- package/front_end/third_party/lit-html/package/directives/repeat.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/directives/repeat.js +2 -5
- package/front_end/third_party/lit-html/package/directives/repeat.js.map +1 -1
- package/front_end/third_party/lit-html/package/directives/style-map.d.ts +1 -2
- package/front_end/third_party/lit-html/package/directives/style-map.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/directives/style-map.js +2 -4
- package/front_end/third_party/lit-html/package/directives/style-map.js.map +1 -1
- package/front_end/third_party/lit-html/package/directives/template-content.d.ts +1 -2
- package/front_end/third_party/lit-html/package/directives/template-content.js +2 -4
- package/front_end/third_party/lit-html/package/directives/template-content.js.map +1 -1
- package/front_end/third_party/lit-html/package/directives/unsafe-html.d.ts +6 -4
- package/front_end/third_party/lit-html/package/directives/unsafe-html.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/directives/unsafe-html.js +2 -4
- package/front_end/third_party/lit-html/package/directives/unsafe-html.js.map +1 -1
- package/front_end/third_party/lit-html/package/directives/unsafe-svg.d.ts +4 -1
- package/front_end/third_party/lit-html/package/directives/unsafe-svg.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/directives/unsafe-svg.js.map +1 -1
- package/front_end/third_party/lit-html/package/directives/until.d.ts +12 -8
- package/front_end/third_party/lit-html/package/directives/until.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/directives/until.js +2 -6
- package/front_end/third_party/lit-html/package/directives/until.js.map +1 -1
- package/front_end/third_party/lit-html/package/experimental-hydrate.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/experimental-hydrate.js +2 -5
- package/front_end/third_party/lit-html/package/experimental-hydrate.js.map +1 -1
- package/front_end/third_party/lit-html/package/lit-html.d.ts +81 -136
- package/front_end/third_party/lit-html/package/lit-html.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/lit-html.js +1 -1
- package/front_end/third_party/lit-html/package/lit-html.js.map +1 -1
- package/front_end/third_party/lit-html/package/package.json +75 -24
- package/front_end/third_party/lit-html/package/polyfill-support.d.ts +1 -41
- package/front_end/third_party/lit-html/package/polyfill-support.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/polyfill-support.js +1 -1
- package/front_end/third_party/lit-html/package/polyfill-support.js.map +1 -1
- package/front_end/third_party/lit-html/package/private-ssr-support.d.ts +12 -10
- package/front_end/third_party/lit-html/package/private-ssr-support.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/private-ssr-support.js +2 -2
- package/front_end/third_party/lit-html/package/private-ssr-support.js.map +1 -1
- package/front_end/third_party/lit-html/package/static.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/static.js +1 -1
- package/front_end/third_party/lit-html/package/static.js.map +1 -1
- package/front_end/third_party/marked/README.chromium +2 -2
- package/front_end/third_party/marked/marked.ts +2 -2
- package/front_end/third_party/marked/package/README.md +7 -1
- package/front_end/third_party/marked/package/bin/marked.js +214 -0
- package/front_end/third_party/marked/package/lib/marked.cjs +2907 -0
- package/front_end/third_party/marked/package/lib/marked.esm.d.ts +1 -3
- package/front_end/third_party/marked/package/lib/marked.esm.js +627 -586
- package/front_end/third_party/marked/package/lib/marked.umd.js +2913 -0
- package/front_end/third_party/marked/package/man/marked.1 +5 -24
- package/front_end/third_party/marked/package/man/marked.1.txt +21 -31
- package/front_end/third_party/marked/package/marked.min.js +1 -1
- package/front_end/third_party/marked/package/package.json +41 -32
- package/front_end/third_party/marked/package/src/Lexer.js +109 -108
- package/front_end/third_party/marked/package/src/Parser.js +38 -15
- package/front_end/third_party/marked/package/src/Renderer.js +5 -5
- package/front_end/third_party/marked/package/src/Slugger.js +2 -2
- package/front_end/third_party/marked/package/src/TextRenderer.js +2 -2
- package/front_end/third_party/marked/package/src/Tokenizer.js +215 -190
- package/front_end/third_party/marked/package/src/defaults.js +6 -9
- package/front_end/third_party/marked/package/src/helpers.js +16 -27
- package/front_end/third_party/marked/package/src/marked.js +146 -63
- package/front_end/third_party/marked/package/src/rules.js +20 -45
- package/front_end/third_party/wasmparser/README.chromium +2 -2
- package/front_end/third_party/wasmparser/package/.github/workflows/main.yml +47 -0
- package/front_end/third_party/wasmparser/package/CHANGELOG.md +12 -0
- package/front_end/third_party/wasmparser/package/dist/cjs/WasmParser.js +53 -53
- package/front_end/third_party/wasmparser/package/dist/cjs/WasmParser.js.map +1 -1
- package/front_end/third_party/wasmparser/package/dist/esm/WasmParser.js +53 -53
- package/front_end/third_party/wasmparser/package/dist/esm/WasmParser.js.map +1 -1
- package/front_end/third_party/wasmparser/package/package.json +1 -1
- package/front_end/third_party/wasmparser/package/src/WasmParser.ts +53 -53
- package/front_end/ui/components/adorners/Adorner.ts +14 -14
- package/front_end/ui/components/buttons/Button.ts +116 -42
- package/front_end/ui/components/data_grid/DataGrid.ts +122 -122
- package/front_end/ui/components/data_grid/DataGridController.ts +42 -42
- package/front_end/ui/components/diff_view/DiffView.ts +4 -4
- package/front_end/ui/components/docs/button/basic.html +3 -0
- package/front_end/ui/components/docs/button/basic.ts +16 -0
- package/front_end/ui/components/expandable_list/ExpandableList.ts +11 -11
- package/front_end/ui/components/icon_button/Icon.ts +24 -21
- package/front_end/ui/components/icon_button/IconButton.ts +31 -31
- package/front_end/ui/components/issue_counter/IssueCounter.ts +52 -52
- package/front_end/ui/components/issue_counter/IssueLinkIcon.ts +42 -42
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspector.ts +67 -67
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspectorController.ts +22 -22
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspectorPane.ts +36 -36
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryNavigator.ts +19 -19
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryValueInterpreter.ts +25 -25
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryViewer.ts +52 -52
- package/front_end/ui/components/linear_memory_inspector/ValueInterpreterDisplay.ts +21 -21
- package/front_end/ui/components/linear_memory_inspector/ValueInterpreterSettings.ts +6 -6
- package/front_end/ui/components/markdown_view/MarkdownImage.ts +14 -14
- package/front_end/ui/components/markdown_view/MarkdownLink.ts +8 -8
- package/front_end/ui/components/markdown_view/MarkdownView.ts +6 -6
- package/front_end/ui/components/render_coordinator/RenderCoordinator.ts +33 -33
- package/front_end/ui/components/report_view/ReportView.ts +18 -18
- package/front_end/ui/components/request_link_icon/RequestLinkIcon.ts +53 -53
- package/front_end/ui/components/settings/SettingCheckbox.ts +15 -15
- package/front_end/ui/components/survey_link/SurveyLink.ts +28 -28
- package/front_end/ui/components/text_editor/TextEditor.ts +65 -36
- package/front_end/ui/components/text_editor/config.ts +36 -14
- package/front_end/ui/components/text_editor/javascript.ts +20 -15
- package/front_end/ui/components/text_editor/theme.ts +29 -4
- package/front_end/ui/components/text_prompt/TextPrompt.ts +19 -19
- package/front_end/ui/components/tree_outline/TreeOutline.ts +56 -56
- package/front_end/ui/legacy/Infobar.ts +9 -0
- package/front_end/ui/legacy/InspectorView.ts +1 -1
- package/front_end/ui/legacy/ViewManager.ts +6 -0
- package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +20 -0
- package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +1 -0
- package/front_end/ui/legacy/components/utils/Linkifier.ts +49 -79
- package/front_end/ui/legacy/tabbedPane.css +1 -1
- package/front_end/ui/legacy/themeColors.css +2 -0
- package/inspector_overlay/main.ts +3 -0
- package/package.json +1 -1
|
@@ -90,7 +90,7 @@ export const enum QueryType {
|
|
|
90
90
|
PropertyExpression = 2,
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
export function getQueryType(tree: CodeMirror.Tree, pos: number): {
|
|
93
|
+
export function getQueryType(tree: CodeMirror.Tree, pos: number, doc: CodeMirror.Text): {
|
|
94
94
|
type: QueryType,
|
|
95
95
|
from?: number,
|
|
96
96
|
relatedNode?: CodeMirror.SyntaxNode,
|
|
@@ -101,13 +101,15 @@ export function getQueryType(tree: CodeMirror.Tree, pos: number): {
|
|
|
101
101
|
return null;
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
if (node.name === 'VariableName') {
|
|
105
|
-
return {type: QueryType.Expression, from: node.from};
|
|
106
|
-
}
|
|
107
104
|
if (node.name === 'PropertyName') {
|
|
108
105
|
return parent?.name !== 'MemberExpression' ? null :
|
|
109
106
|
{type: QueryType.PropertyName, from: node.from, relatedNode: parent};
|
|
110
107
|
}
|
|
108
|
+
if (node.name === 'VariableName' ||
|
|
109
|
+
// Treat alphabetic keywords as variables
|
|
110
|
+
!node.firstChild && node.to - node.from < 20 && !/[^a-z]/.test(doc.sliceString(node.from, node.to))) {
|
|
111
|
+
return {type: QueryType.Expression, from: node.from};
|
|
112
|
+
}
|
|
111
113
|
if (node.name === 'String') {
|
|
112
114
|
const parent = node.parent;
|
|
113
115
|
return parent?.name === 'MemberExpression' && parent.childBefore(node.from)?.name === '[' ?
|
|
@@ -134,8 +136,8 @@ export function getQueryType(tree: CodeMirror.Tree, pos: number): {
|
|
|
134
136
|
|
|
135
137
|
export async function javascriptCompletionSource(cx: CodeMirror.CompletionContext):
|
|
136
138
|
Promise<CodeMirror.CompletionResult|null> {
|
|
137
|
-
const query = getQueryType(CodeMirror.syntaxTree(cx.state), cx.pos);
|
|
138
|
-
if (!query || query.from === undefined && !cx.explicit) {
|
|
139
|
+
const query = getQueryType(CodeMirror.syntaxTree(cx.state), cx.pos, cx.state.doc);
|
|
140
|
+
if (!query || query.from === undefined && !cx.explicit && query.type === QueryType.Expression) {
|
|
139
141
|
return null;
|
|
140
142
|
}
|
|
141
143
|
|
|
@@ -162,7 +164,8 @@ export async function javascriptCompletionSource(cx: CodeMirror.CompletionContex
|
|
|
162
164
|
if (!objectExpr) {
|
|
163
165
|
return null;
|
|
164
166
|
}
|
|
165
|
-
result = await completeProperties(
|
|
167
|
+
result = await completeProperties(
|
|
168
|
+
cx.state.sliceDoc(objectExpr.from, objectExpr.to), quote, cx.state.sliceDoc(cx.pos, cx.pos + 1) === ']');
|
|
166
169
|
} else {
|
|
167
170
|
return null;
|
|
168
171
|
}
|
|
@@ -214,10 +217,10 @@ let cacheInstance: PropertyCache|null = null;
|
|
|
214
217
|
// Store recent collections of property completions. The empty string
|
|
215
218
|
// is used to store the set of global bindings.
|
|
216
219
|
class PropertyCache {
|
|
217
|
-
|
|
220
|
+
readonly #cache: Map<string, Promise<CompletionSet>> = new Map();
|
|
218
221
|
|
|
219
222
|
constructor() {
|
|
220
|
-
const clear = (): void => this
|
|
223
|
+
const clear = (): void => this.#cache.clear();
|
|
221
224
|
SDK.ConsoleModel.ConsoleModel.instance().addEventListener(SDK.ConsoleModel.Events.CommandEvaluated, clear);
|
|
222
225
|
UI.Context.Context.instance().addFlavorChangeListener(SDK.RuntimeModel.ExecutionContext, clear);
|
|
223
226
|
SDK.TargetManager.TargetManager.instance().addModelListener(
|
|
@@ -227,14 +230,14 @@ class PropertyCache {
|
|
|
227
230
|
}
|
|
228
231
|
|
|
229
232
|
get(expression: string): Promise<CompletionSet>|undefined {
|
|
230
|
-
return this
|
|
233
|
+
return this.#cache.get(expression);
|
|
231
234
|
}
|
|
232
235
|
|
|
233
236
|
set(expression: string, value: Promise<CompletionSet>): void {
|
|
234
|
-
this
|
|
237
|
+
this.#cache.set(expression, value);
|
|
235
238
|
setTimeout(() => {
|
|
236
|
-
if (this
|
|
237
|
-
this
|
|
239
|
+
if (this.#cache.get(expression) === value) {
|
|
240
|
+
this.#cache.delete(expression);
|
|
238
241
|
}
|
|
239
242
|
}, maxCacheAge);
|
|
240
243
|
}
|
|
@@ -250,6 +253,7 @@ class PropertyCache {
|
|
|
250
253
|
async function completeProperties(
|
|
251
254
|
expression: string,
|
|
252
255
|
quoted?: string,
|
|
256
|
+
hasBracket: boolean = false,
|
|
253
257
|
): Promise<CompletionSet> {
|
|
254
258
|
const cache = PropertyCache.instance();
|
|
255
259
|
if (!quoted) {
|
|
@@ -262,7 +266,7 @@ async function completeProperties(
|
|
|
262
266
|
if (!context) {
|
|
263
267
|
return new CompletionSet();
|
|
264
268
|
}
|
|
265
|
-
const result = completePropertiesInner(expression, context, quoted);
|
|
269
|
+
const result = completePropertiesInner(expression, context, quoted, hasBracket);
|
|
266
270
|
if (!quoted) {
|
|
267
271
|
cache.set(expression, result);
|
|
268
272
|
}
|
|
@@ -275,6 +279,7 @@ async function completePropertiesInner(
|
|
|
275
279
|
expression: string,
|
|
276
280
|
context: SDK.RuntimeModel.ExecutionContext,
|
|
277
281
|
quoted?: string,
|
|
282
|
+
hasBracket: boolean = false,
|
|
278
283
|
): Promise<CompletionSet> {
|
|
279
284
|
const result = new CompletionSet();
|
|
280
285
|
if (!context) {
|
|
@@ -313,7 +318,7 @@ async function completePropertiesInner(
|
|
|
313
318
|
label,
|
|
314
319
|
type: prop.value?.type === 'function' ? functionType : otherType,
|
|
315
320
|
};
|
|
316
|
-
if (quoted) {
|
|
321
|
+
if (quoted && !hasBracket) {
|
|
317
322
|
completion.apply = label + ']';
|
|
318
323
|
}
|
|
319
324
|
if (!prop.isOwn) {
|
|
@@ -18,7 +18,7 @@ export const editorTheme = CM.EditorView.theme({
|
|
|
18
18
|
fontSize: 'var(--source-code-font-size)',
|
|
19
19
|
},
|
|
20
20
|
|
|
21
|
-
'.cm-panels
|
|
21
|
+
'.cm-panels': {
|
|
22
22
|
backgroundColor: 'var(--color-background-elevation-1)',
|
|
23
23
|
},
|
|
24
24
|
|
|
@@ -110,25 +110,50 @@ export const editorTheme = CM.EditorView.theme({
|
|
|
110
110
|
color: 'var(--color-text-secondary)',
|
|
111
111
|
},
|
|
112
112
|
|
|
113
|
+
'.cm-tooltip': {
|
|
114
|
+
boxShadow: 'var(--drop-shadow)',
|
|
115
|
+
backgroundColor: 'var(--color-background-elevation-1)',
|
|
116
|
+
},
|
|
117
|
+
|
|
113
118
|
'.cm-argumentHints': {
|
|
114
119
|
pointerEvents: 'none',
|
|
115
120
|
padding: '0 4px',
|
|
116
121
|
whiteSpace: 'nowrap',
|
|
117
122
|
lineHeight: '20px',
|
|
118
123
|
marginBottom: '4px',
|
|
119
|
-
boxShadow: 'var(--drop-shadow)',
|
|
120
|
-
backgroundColor: 'var(--color-background)',
|
|
121
124
|
width: 'fit-content',
|
|
122
125
|
},
|
|
123
126
|
|
|
124
127
|
'.cm-tooltip.cm-tooltip-autocomplete > ul': {
|
|
128
|
+
backgroundColor: 'var(--color-background)',
|
|
125
129
|
minWidth: '16em',
|
|
130
|
+
'& > li.cm-secondaryCompletion': {
|
|
131
|
+
display: 'flex',
|
|
132
|
+
backgroundColor: 'var(--color-background-elevation-1)',
|
|
133
|
+
justifyContent: 'space-between',
|
|
134
|
+
'&::before': {
|
|
135
|
+
content: '">"',
|
|
136
|
+
fontWeight: 'bold',
|
|
137
|
+
color: 'var(--color-primary-variant)',
|
|
138
|
+
marginRight: '5px',
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
'& > li:hover': {
|
|
142
|
+
backgroundColor: 'var(--item-hover-color)',
|
|
143
|
+
},
|
|
126
144
|
'& > li[aria-selected]': {
|
|
127
145
|
backgroundColor: 'var(--color-selected-option-background)',
|
|
128
|
-
|
|
146
|
+
'&, &.cm-secondaryCompletion::before': {
|
|
147
|
+
color: 'var(--color-selected-option)',
|
|
148
|
+
},
|
|
129
149
|
},
|
|
130
150
|
},
|
|
131
151
|
|
|
152
|
+
'.cm-completionMatchedText': {
|
|
153
|
+
textDecoration: 'none',
|
|
154
|
+
fontWeight: 'bold',
|
|
155
|
+
},
|
|
156
|
+
|
|
132
157
|
'.cm-highlightedLine': {
|
|
133
158
|
animation: 'cm-fading-highlight 2s 0s',
|
|
134
159
|
},
|
|
@@ -26,27 +26,27 @@ export class PromptInputEvent extends Event {
|
|
|
26
26
|
|
|
27
27
|
export class TextPrompt extends HTMLElement {
|
|
28
28
|
static readonly litTagName = LitHtml.literal`devtools-text-prompt`;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
readonly #shadow = this.attachShadow({mode: 'open'});
|
|
30
|
+
#ariaLabelText = '';
|
|
31
|
+
#prefixText = '';
|
|
32
|
+
#suggestionText = '';
|
|
33
33
|
|
|
34
34
|
connectedCallback(): void {
|
|
35
|
-
this
|
|
35
|
+
this.#shadow.adoptedStyleSheets = [textPromptStyles];
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
set data(data: TextPromptData) {
|
|
39
|
-
this
|
|
40
|
-
this
|
|
41
|
-
this
|
|
39
|
+
this.#ariaLabelText = data.ariaLabel;
|
|
40
|
+
this.#prefixText = data.prefix;
|
|
41
|
+
this.#suggestionText = data.suggestion;
|
|
42
42
|
this.render();
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
get data(): TextPromptData {
|
|
46
46
|
return {
|
|
47
|
-
ariaLabel: this
|
|
48
|
-
prefix: this
|
|
49
|
-
suggestion: this
|
|
47
|
+
ariaLabel: this.#ariaLabelText,
|
|
48
|
+
prefix: this.#prefixText,
|
|
49
|
+
suggestion: this.#suggestionText,
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
52
|
|
|
@@ -55,7 +55,7 @@ export class TextPrompt extends HTMLElement {
|
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
private input(): HTMLInputElement {
|
|
58
|
-
const inputElement = this
|
|
58
|
+
const inputElement = this.#shadow.querySelector<HTMLInputElement>('input');
|
|
59
59
|
if (!inputElement) {
|
|
60
60
|
throw new Error('Expected an input element!');
|
|
61
61
|
}
|
|
@@ -92,12 +92,12 @@ export class TextPrompt extends HTMLElement {
|
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
setPrefix(prefix: string): void {
|
|
95
|
-
this
|
|
95
|
+
this.#prefixText = prefix;
|
|
96
96
|
this.render();
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
setSuggestion(suggestion: string): void {
|
|
100
|
-
this
|
|
100
|
+
this.#suggestionText = suggestion;
|
|
101
101
|
this.render();
|
|
102
102
|
}
|
|
103
103
|
|
|
@@ -112,7 +112,7 @@ export class TextPrompt extends HTMLElement {
|
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
private suggestion(): HTMLSpanElement {
|
|
115
|
-
const suggestionElement = this
|
|
115
|
+
const suggestionElement = this.#shadow.querySelector<HTMLSpanElement>('.suggestion');
|
|
116
116
|
if (!suggestionElement) {
|
|
117
117
|
throw new Error('Expected an suggestion element!');
|
|
118
118
|
}
|
|
@@ -125,11 +125,11 @@ export class TextPrompt extends HTMLElement {
|
|
|
125
125
|
|
|
126
126
|
private render(): void {
|
|
127
127
|
const output = LitHtml.html`
|
|
128
|
-
<span class="prefix">${this
|
|
129
|
-
<span class="text-prompt-input"><input aria-label=${this
|
|
128
|
+
<span class="prefix">${this.#prefixText} </span>
|
|
129
|
+
<span class="text-prompt-input"><input aria-label=${this.#ariaLabelText} spellcheck="false" @input=${
|
|
130
130
|
this.onInput} @keydown=${this.onKeyDown}/><span class='suggestion' suggestion="${
|
|
131
|
-
this
|
|
132
|
-
LitHtml.render(output, this
|
|
131
|
+
this.#suggestionText}"></span></span>`;
|
|
132
|
+
LitHtml.render(output, this.#shadow, {host: this});
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
135
|
|
|
@@ -82,20 +82,20 @@ export const enum FilterOption {
|
|
|
82
82
|
|
|
83
83
|
export class TreeOutline<TreeNodeDataType> extends HTMLElement {
|
|
84
84
|
static readonly litTagName = LitHtml.literal`devtools-tree-outline`;
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
85
|
+
readonly #shadow = this.attachShadow({mode: 'open'});
|
|
86
|
+
#treeData: readonly TreeNode<TreeNodeDataType>[] = [];
|
|
87
|
+
#nodeExpandedMap: Map<string, boolean> = new Map();
|
|
88
|
+
#domNodeToTreeNodeMap: WeakMap<HTMLLIElement, TreeNode<TreeNodeDataType>> = new WeakMap();
|
|
89
|
+
#hasRenderedAtLeastOnce = false;
|
|
90
90
|
/**
|
|
91
91
|
* If we have expanded to a certain node, we want to focus it once we've
|
|
92
92
|
* rendered. But we render lazily and wrapped in LitHtml.until, so we can't
|
|
93
93
|
* know for sure when that node will be rendered. This variable tracks the
|
|
94
94
|
* node that we want focused but may not yet have been rendered.
|
|
95
95
|
*/
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
96
|
+
#nodeIdPendingFocus: TreeNodeId|null = null;
|
|
97
|
+
#selectedTreeNode: TreeNode<TreeNodeDataType>|null = null;
|
|
98
|
+
#defaultRenderer =
|
|
99
99
|
(node: TreeNode<TreeNodeDataType>, _state: {isExpanded: boolean}): LitHtml.TemplateResult => {
|
|
100
100
|
if (typeof node.treeNodeData !== 'string') {
|
|
101
101
|
console.warn(`The default TreeOutline renderer simply stringifies its given value. You passed in ${
|
|
@@ -105,16 +105,16 @@ export class TreeOutline<TreeNodeDataType> extends HTMLElement {
|
|
|
105
105
|
}
|
|
106
106
|
return LitHtml.html`${String(node.treeNodeData)}`;
|
|
107
107
|
};
|
|
108
|
-
|
|
108
|
+
#nodeFilter?: ((node: TreeNodeDataType) => FilterOption);
|
|
109
109
|
|
|
110
110
|
/**
|
|
111
111
|
* scheduledRender = render() has been called and scheduled a render.
|
|
112
112
|
*/
|
|
113
|
-
|
|
113
|
+
#scheduledRender = false;
|
|
114
114
|
/**
|
|
115
115
|
* enqueuedRender = render() was called mid-way through an existing render.
|
|
116
116
|
*/
|
|
117
|
-
|
|
117
|
+
#enqueuedRender = false;
|
|
118
118
|
|
|
119
119
|
static get observedAttributes(): string[] {
|
|
120
120
|
return ['nowrap', 'toplevelbordercolor'];
|
|
@@ -136,22 +136,22 @@ export class TreeOutline<TreeNodeDataType> extends HTMLElement {
|
|
|
136
136
|
connectedCallback(): void {
|
|
137
137
|
this.setTopLevelNodeBorderColorCSSVariable(this.getAttribute('toplevelbordercolor'));
|
|
138
138
|
this.setNodeKeyNoWrapCSSVariable(this.getAttribute('nowrap'));
|
|
139
|
-
this
|
|
139
|
+
this.#shadow.adoptedStyleSheets = [treeOutlineStyles, CodeHighlighter.Style.default];
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
get data(): TreeOutlineData<TreeNodeDataType> {
|
|
143
143
|
return {
|
|
144
|
-
tree: this
|
|
145
|
-
defaultRenderer: this
|
|
144
|
+
tree: this.#treeData as TreeNode<TreeNodeDataType>[],
|
|
145
|
+
defaultRenderer: this.#defaultRenderer,
|
|
146
146
|
};
|
|
147
147
|
}
|
|
148
148
|
|
|
149
149
|
set data(data: TreeOutlineData<TreeNodeDataType>) {
|
|
150
|
-
this
|
|
151
|
-
this
|
|
152
|
-
this
|
|
153
|
-
if (!this
|
|
154
|
-
this
|
|
150
|
+
this.#defaultRenderer = data.defaultRenderer;
|
|
151
|
+
this.#treeData = data.tree;
|
|
152
|
+
this.#nodeFilter = data.filter;
|
|
153
|
+
if (!this.#hasRenderedAtLeastOnce) {
|
|
154
|
+
this.#selectedTreeNode = this.#treeData[0];
|
|
155
155
|
}
|
|
156
156
|
this.render();
|
|
157
157
|
}
|
|
@@ -162,7 +162,7 @@ export class TreeOutline<TreeNodeDataType> extends HTMLElement {
|
|
|
162
162
|
* 1 and 2.
|
|
163
163
|
*/
|
|
164
164
|
async expandRecursively(maxDepth = 2): Promise<void> {
|
|
165
|
-
await Promise.all(this
|
|
165
|
+
await Promise.all(this.#treeData.map(rootNode => this.expandAndRecurse(rootNode, 0, maxDepth)));
|
|
166
166
|
await this.render();
|
|
167
167
|
}
|
|
168
168
|
|
|
@@ -170,7 +170,7 @@ export class TreeOutline<TreeNodeDataType> extends HTMLElement {
|
|
|
170
170
|
* Collapses all nodes in the tree.
|
|
171
171
|
*/
|
|
172
172
|
async collapseAllNodes(): Promise<void> {
|
|
173
|
-
this
|
|
173
|
+
this.#nodeExpandedMap.clear();
|
|
174
174
|
await this.render();
|
|
175
175
|
}
|
|
176
176
|
|
|
@@ -185,7 +185,7 @@ export class TreeOutline<TreeNodeDataType> extends HTMLElement {
|
|
|
185
185
|
* Takes a TreeNode ID, expands the outline to reveal it, and focuses it.
|
|
186
186
|
*/
|
|
187
187
|
async expandToAndSelectTreeNodeId(targetTreeNodeId: TreeNodeId): Promise<void> {
|
|
188
|
-
const pathToTreeNode = await getPathToTreeNode(this
|
|
188
|
+
const pathToTreeNode = await getPathToTreeNode(this.#treeData, targetTreeNodeId);
|
|
189
189
|
|
|
190
190
|
if (pathToTreeNode === null) {
|
|
191
191
|
throw new Error(`Could not find node with id ${targetTreeNodeId} in the tree.`);
|
|
@@ -198,7 +198,7 @@ export class TreeOutline<TreeNodeDataType> extends HTMLElement {
|
|
|
198
198
|
});
|
|
199
199
|
|
|
200
200
|
// Mark the node as pending focus so when it is rendered into the DOM we can focus it
|
|
201
|
-
this
|
|
201
|
+
this.#nodeIdPendingFocus = targetTreeNodeId;
|
|
202
202
|
await this.render();
|
|
203
203
|
}
|
|
204
204
|
|
|
@@ -206,7 +206,7 @@ export class TreeOutline<TreeNodeDataType> extends HTMLElement {
|
|
|
206
206
|
* Takes a list of TreeNode IDs and expands the corresponding nodes.
|
|
207
207
|
*/
|
|
208
208
|
expandNodeIds(nodeIds: TreeNodeId[]): Promise<void> {
|
|
209
|
-
nodeIds.forEach(id => this
|
|
209
|
+
nodeIds.forEach(id => this.#nodeExpandedMap.set(id, true));
|
|
210
210
|
return this.render();
|
|
211
211
|
}
|
|
212
212
|
|
|
@@ -214,12 +214,12 @@ export class TreeOutline<TreeNodeDataType> extends HTMLElement {
|
|
|
214
214
|
* Takes a TreeNode ID and focuses the corresponding node.
|
|
215
215
|
*/
|
|
216
216
|
focusNodeId(nodeId: TreeNodeId): Promise<void> {
|
|
217
|
-
this
|
|
217
|
+
this.#nodeIdPendingFocus = nodeId;
|
|
218
218
|
return this.render();
|
|
219
219
|
}
|
|
220
220
|
|
|
221
221
|
async collapseChildrenOfNode(domNode: HTMLLIElement): Promise<void> {
|
|
222
|
-
const treeNode = this
|
|
222
|
+
const treeNode = this.#domNodeToTreeNodeMap.get(domNode);
|
|
223
223
|
if (!treeNode) {
|
|
224
224
|
return;
|
|
225
225
|
}
|
|
@@ -248,22 +248,22 @@ export class TreeOutline<TreeNodeDataType> extends HTMLElement {
|
|
|
248
248
|
}
|
|
249
249
|
|
|
250
250
|
private getSelectedTreeNode(): TreeNode<TreeNodeDataType> {
|
|
251
|
-
if (!this
|
|
251
|
+
if (!this.#selectedTreeNode) {
|
|
252
252
|
throw new Error('getSelectedNode was called but selectedTreeNode is null');
|
|
253
253
|
}
|
|
254
|
-
return this
|
|
254
|
+
return this.#selectedTreeNode;
|
|
255
255
|
}
|
|
256
256
|
|
|
257
257
|
private async fetchNodeChildren(node: TreeNodeWithChildren<TreeNodeDataType>): Promise<TreeNode<TreeNodeDataType>[]> {
|
|
258
258
|
const children = await getNodeChildren(node);
|
|
259
|
-
if (!this
|
|
259
|
+
if (!this.#nodeFilter) {
|
|
260
260
|
return children;
|
|
261
261
|
}
|
|
262
262
|
const filteredChildren = [];
|
|
263
263
|
for (const child of children) {
|
|
264
|
-
const filtering = this
|
|
264
|
+
const filtering = this.#nodeFilter(child.treeNodeData);
|
|
265
265
|
// We always include the selected node in the tree, regardless of its filtering status.
|
|
266
|
-
if (filtering === FilterOption.SHOW || this.isSelectedNode(child) || child.id === this
|
|
266
|
+
if (filtering === FilterOption.SHOW || this.isSelectedNode(child) || child.id === this.#nodeIdPendingFocus) {
|
|
267
267
|
filteredChildren.push(child);
|
|
268
268
|
} else if (filtering === FilterOption.FLATTEN && isExpandableNode(child)) {
|
|
269
269
|
const grandChildren = await this.fetchNodeChildren(child);
|
|
@@ -274,11 +274,11 @@ export class TreeOutline<TreeNodeDataType> extends HTMLElement {
|
|
|
274
274
|
}
|
|
275
275
|
|
|
276
276
|
private setNodeExpandedState(node: TreeNode<TreeNodeDataType>, newExpandedState: boolean): void {
|
|
277
|
-
this
|
|
277
|
+
this.#nodeExpandedMap.set(node.id, newExpandedState);
|
|
278
278
|
}
|
|
279
279
|
|
|
280
280
|
private nodeIsExpanded(node: TreeNode<TreeNodeDataType>): boolean {
|
|
281
|
-
return this
|
|
281
|
+
return this.#nodeExpandedMap.get(node.id) || false;
|
|
282
282
|
}
|
|
283
283
|
|
|
284
284
|
private async expandAndRecurse(node: TreeNode<TreeNodeDataType>, currentDepth: number, maxDepth: number):
|
|
@@ -309,7 +309,7 @@ export class TreeOutline<TreeNodeDataType> extends HTMLElement {
|
|
|
309
309
|
event.stopPropagation();
|
|
310
310
|
const nodeClickExpandsOrContracts = this.getAttribute('clickabletitle') !== null;
|
|
311
311
|
const domNode = event.currentTarget as HTMLLIElement;
|
|
312
|
-
const node = this
|
|
312
|
+
const node = this.#domNodeToTreeNodeMap.get(domNode);
|
|
313
313
|
if (nodeClickExpandsOrContracts && node && isExpandableNode(node)) {
|
|
314
314
|
this.setNodeExpandedState(node, !this.nodeIsExpanded(node));
|
|
315
315
|
}
|
|
@@ -317,11 +317,11 @@ export class TreeOutline<TreeNodeDataType> extends HTMLElement {
|
|
|
317
317
|
}
|
|
318
318
|
|
|
319
319
|
private async focusTreeNode(domNode: HTMLLIElement): Promise<void> {
|
|
320
|
-
const treeNode = this
|
|
320
|
+
const treeNode = this.#domNodeToTreeNodeMap.get(domNode);
|
|
321
321
|
if (!treeNode) {
|
|
322
322
|
return;
|
|
323
323
|
}
|
|
324
|
-
this
|
|
324
|
+
this.#selectedTreeNode = treeNode;
|
|
325
325
|
await this.render();
|
|
326
326
|
this.dispatchEvent(new ItemSelectedEvent(treeNode));
|
|
327
327
|
coordinator.write('DOMNode focus', () => {
|
|
@@ -331,7 +331,7 @@ export class TreeOutline<TreeNodeDataType> extends HTMLElement {
|
|
|
331
331
|
|
|
332
332
|
private processHomeAndEndKeysNavigation(key: 'Home'|'End'): void {
|
|
333
333
|
if (key === 'Home') {
|
|
334
|
-
const firstRootNode = this
|
|
334
|
+
const firstRootNode = this.#shadow.querySelector<HTMLLIElement>('ul[role="tree"] > li[role="treeitem"]');
|
|
335
335
|
if (firstRootNode) {
|
|
336
336
|
this.focusTreeNode(firstRootNode);
|
|
337
337
|
}
|
|
@@ -345,7 +345,7 @@ export class TreeOutline<TreeNodeDataType> extends HTMLElement {
|
|
|
345
345
|
* li[role="treeitem"] in the DOM because we only render visible nodes.
|
|
346
346
|
* Therefore we can select all the nodes and pick the last one.
|
|
347
347
|
*/
|
|
348
|
-
const allTreeItems = this
|
|
348
|
+
const allTreeItems = this.#shadow.querySelectorAll<HTMLLIElement>('li[role="treeitem"]');
|
|
349
349
|
const lastTreeItem = allTreeItems[allTreeItems.length - 1];
|
|
350
350
|
if (lastTreeItem) {
|
|
351
351
|
this.focusTreeNode(lastTreeItem);
|
|
@@ -355,7 +355,7 @@ export class TreeOutline<TreeNodeDataType> extends HTMLElement {
|
|
|
355
355
|
|
|
356
356
|
private async processArrowKeyNavigation(key: Platform.KeyboardUtilities.ArrowKey, currentDOMNode: HTMLLIElement):
|
|
357
357
|
Promise<void> {
|
|
358
|
-
const currentTreeNode = this
|
|
358
|
+
const currentTreeNode = this.#domNodeToTreeNodeMap.get(currentDOMNode);
|
|
359
359
|
if (!currentTreeNode) {
|
|
360
360
|
return;
|
|
361
361
|
}
|
|
@@ -370,7 +370,7 @@ export class TreeOutline<TreeNodeDataType> extends HTMLElement {
|
|
|
370
370
|
}
|
|
371
371
|
|
|
372
372
|
private processEnterOrSpaceNavigation(currentDOMNode: HTMLLIElement): void {
|
|
373
|
-
const currentTreeNode = this
|
|
373
|
+
const currentTreeNode = this.#domNodeToTreeNodeMap.get(currentDOMNode);
|
|
374
374
|
if (!currentTreeNode) {
|
|
375
375
|
return;
|
|
376
376
|
}
|
|
@@ -399,13 +399,13 @@ export class TreeOutline<TreeNodeDataType> extends HTMLElement {
|
|
|
399
399
|
}
|
|
400
400
|
|
|
401
401
|
private focusPendingNode(domNode: HTMLLIElement): void {
|
|
402
|
-
this
|
|
402
|
+
this.#nodeIdPendingFocus = null;
|
|
403
403
|
this.focusTreeNode(domNode);
|
|
404
404
|
}
|
|
405
405
|
|
|
406
406
|
private isSelectedNode(node: TreeNode<TreeNodeDataType>): boolean {
|
|
407
|
-
if (this
|
|
408
|
-
return node.id === this
|
|
407
|
+
if (this.#selectedTreeNode) {
|
|
408
|
+
return node.id === this.#selectedTreeNode.id;
|
|
409
409
|
}
|
|
410
410
|
return false;
|
|
411
411
|
}
|
|
@@ -446,7 +446,7 @@ export class TreeOutline<TreeNodeDataType> extends HTMLElement {
|
|
|
446
446
|
if (node.renderer) {
|
|
447
447
|
renderedNodeKey = node.renderer(node, {isExpanded: nodeIsExpanded});
|
|
448
448
|
} else {
|
|
449
|
-
renderedNodeKey = this
|
|
449
|
+
renderedNodeKey = this.#defaultRenderer(node, {isExpanded: nodeIsExpanded});
|
|
450
450
|
}
|
|
451
451
|
|
|
452
452
|
// Disabled until https://crbug.com/1079231 is fixed.
|
|
@@ -460,7 +460,7 @@ export class TreeOutline<TreeNodeDataType> extends HTMLElement {
|
|
|
460
460
|
aria-posinset=${positionInSet + 1}
|
|
461
461
|
class=${listItemClasses}
|
|
462
462
|
@click=${this.onNodeClick}
|
|
463
|
-
track-dom-node-to-tree-node=${trackDOMNodeToTreeNode(this
|
|
463
|
+
track-dom-node-to-tree-node=${trackDOMNodeToTreeNode(this.#domNodeToTreeNodeMap, node)}
|
|
464
464
|
on-render=${ComponentHelpers.Directives.nodeRenderedCallback(domNode => {
|
|
465
465
|
/**
|
|
466
466
|
* Because TreeNodes are lazily rendered, you can call
|
|
@@ -473,7 +473,7 @@ export class TreeOutline<TreeNodeDataType> extends HTMLElement {
|
|
|
473
473
|
return;
|
|
474
474
|
}
|
|
475
475
|
|
|
476
|
-
if (this
|
|
476
|
+
if (this.#nodeIdPendingFocus && node.id === this.#nodeIdPendingFocus) {
|
|
477
477
|
this.focusPendingNode(domNode);
|
|
478
478
|
}
|
|
479
479
|
})}
|
|
@@ -497,14 +497,14 @@ export class TreeOutline<TreeNodeDataType> extends HTMLElement {
|
|
|
497
497
|
}
|
|
498
498
|
|
|
499
499
|
private async render(): Promise<void> {
|
|
500
|
-
if (this
|
|
500
|
+
if (this.#scheduledRender) {
|
|
501
501
|
// If we are already rendering, don't render again immediately, but
|
|
502
502
|
// enqueue it to be run after we're done on our current render.
|
|
503
|
-
this
|
|
503
|
+
this.#enqueuedRender = true;
|
|
504
504
|
return;
|
|
505
505
|
}
|
|
506
506
|
|
|
507
|
-
this
|
|
507
|
+
this.#scheduledRender = true;
|
|
508
508
|
|
|
509
509
|
await coordinator.write('TreeOutline render', () => {
|
|
510
510
|
// Disabled until https://crbug.com/1079231 is fixed.
|
|
@@ -512,27 +512,27 @@ export class TreeOutline<TreeNodeDataType> extends HTMLElement {
|
|
|
512
512
|
LitHtml.render(LitHtml.html`
|
|
513
513
|
<div class="wrapping-container">
|
|
514
514
|
<ul role="tree" @keydown=${this.onTreeKeyDown}>
|
|
515
|
-
${this
|
|
515
|
+
${this.#treeData.map((topLevelNode, index) => {
|
|
516
516
|
return this.renderNode(topLevelNode, {
|
|
517
517
|
depth: 0,
|
|
518
|
-
setSize: this
|
|
518
|
+
setSize: this.#treeData.length,
|
|
519
519
|
positionInSet: index,
|
|
520
520
|
});
|
|
521
521
|
})}
|
|
522
522
|
</ul>
|
|
523
523
|
</div>
|
|
524
|
-
`, this
|
|
524
|
+
`, this.#shadow, {
|
|
525
525
|
host: this,
|
|
526
526
|
});
|
|
527
527
|
});
|
|
528
528
|
// clang-format on
|
|
529
|
-
this
|
|
530
|
-
this
|
|
529
|
+
this.#hasRenderedAtLeastOnce = true;
|
|
530
|
+
this.#scheduledRender = false;
|
|
531
531
|
|
|
532
532
|
// If render() was called when we were already mid-render, let's re-render
|
|
533
533
|
// to ensure we're not rendering any stale UI.
|
|
534
|
-
if (this
|
|
535
|
-
this
|
|
534
|
+
if (this.#enqueuedRender) {
|
|
535
|
+
this.#enqueuedRender = false;
|
|
536
536
|
return this.render();
|
|
537
537
|
}
|
|
538
538
|
}
|
|
@@ -48,6 +48,7 @@ export class Infobar {
|
|
|
48
48
|
private readonly toggleElement: HTMLButtonElement;
|
|
49
49
|
private readonly closeButton: HTMLElement;
|
|
50
50
|
private closeCallback: (() => void)|null;
|
|
51
|
+
#firstFocusableElement: HTMLElement|null = null;
|
|
51
52
|
private parentView?: Widget;
|
|
52
53
|
|
|
53
54
|
// TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
|
|
@@ -88,6 +89,9 @@ export class Infobar {
|
|
|
88
89
|
}
|
|
89
90
|
|
|
90
91
|
const button = createTextButton(action.text, actionCallback, buttonClass);
|
|
92
|
+
if (action.highlight && !this.#firstFocusableElement) {
|
|
93
|
+
this.#firstFocusableElement = button;
|
|
94
|
+
}
|
|
91
95
|
this.actionContainer.appendChild(button);
|
|
92
96
|
}
|
|
93
97
|
}
|
|
@@ -202,6 +206,11 @@ export class Infobar {
|
|
|
202
206
|
this.toggleElement.remove();
|
|
203
207
|
this.onResize();
|
|
204
208
|
ARIAUtils.alert(this.detailsMessage);
|
|
209
|
+
if (this.#firstFocusableElement) {
|
|
210
|
+
this.#firstFocusableElement.focus();
|
|
211
|
+
} else {
|
|
212
|
+
this.closeButton.focus();
|
|
213
|
+
}
|
|
205
214
|
}
|
|
206
215
|
|
|
207
216
|
createDetailsRowMessage(message?: string): Element {
|
|
@@ -471,7 +471,7 @@ function createLocaleInfobar(): Infobar {
|
|
|
471
471
|
// @ts-ignore TODO(crbug.com/1163928) Wait for Intl support.
|
|
472
472
|
const locale = new Intl.Locale(closestSupportedLocale);
|
|
473
473
|
const closestSupportedLanguageInCurrentLocale =
|
|
474
|
-
new Intl.DisplayNames([devtoolsLocale.locale], {type: 'language'}).of(locale.language);
|
|
474
|
+
new Intl.DisplayNames([devtoolsLocale.locale], {type: 'language'}).of(locale.language || 'en');
|
|
475
475
|
|
|
476
476
|
const languageSetting = Common.Settings.Settings.instance().moduleSetting<string>('language');
|
|
477
477
|
return new Infobar(
|
|
@@ -828,6 +828,12 @@ export class _TabbedLocation extends Location implements TabbedViewLocation {
|
|
|
828
828
|
this.tabOrderSetting.set(tabOrders);
|
|
829
829
|
}
|
|
830
830
|
|
|
831
|
+
// TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
|
|
832
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
833
|
+
getCloseableTabSetting(): Common.Settings.Setting<any> {
|
|
834
|
+
return this.closeableTabSetting.get();
|
|
835
|
+
}
|
|
836
|
+
|
|
831
837
|
static orderStep = 10; // Keep in sync with descriptors.
|
|
832
838
|
}
|
|
833
839
|
|