chrome-devtools-frontend 1.0.954826 → 1.0.956060
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/.eslintrc.js +1 -0
- package/AUTHORS +1 -0
- package/config/owner/COMMON_OWNERS +2 -2
- package/front_end/.eslintrc.js +1 -11
- package/front_end/core/common/Console.ts +1 -1
- package/front_end/core/common/ResolverBase.ts +1 -1
- package/front_end/core/common/Throttler.ts +1 -1
- package/front_end/core/common/Worker.ts +4 -4
- package/front_end/core/host/InspectorFrontendHost.ts +1 -1
- package/front_end/core/host/ResourceLoader.ts +2 -2
- package/front_end/core/i18n/DevToolsLocale.ts +0 -2
- package/front_end/core/i18n/i18nImpl.ts +0 -2
- package/front_end/core/i18n/locales/en-US.json +3 -0
- package/front_end/core/i18n/locales/en-XL.json +3 -0
- package/front_end/core/sdk/AccessibilityModel.ts +1 -1
- package/front_end/core/sdk/CPUProfilerModel.ts +2 -2
- package/front_end/core/sdk/CPUThrottlingManager.ts +2 -2
- package/front_end/core/sdk/CSSModel.ts +7 -7
- package/front_end/core/sdk/CSSProperty.ts +1 -1
- package/front_end/core/sdk/CSSStyleDeclaration.ts +1 -1
- package/front_end/core/sdk/ChildTargetManager.ts +6 -6
- package/front_end/core/sdk/Connections.ts +2 -2
- package/front_end/core/sdk/ConsoleModel.ts +1 -1
- package/front_end/core/sdk/DOMDebuggerModel.ts +16 -15
- package/front_end/core/sdk/DOMModel.ts +17 -17
- package/front_end/core/sdk/DebuggerModel.ts +24 -24
- package/front_end/core/sdk/EmulationModel.ts +16 -16
- package/front_end/core/sdk/EventBreakpointsModel.ts +2 -2
- package/front_end/core/sdk/IsolateManager.ts +2 -2
- package/front_end/core/sdk/IssuesModel.ts +1 -1
- package/front_end/core/sdk/LogModel.ts +3 -3
- package/front_end/core/sdk/NetworkManager.ts +25 -25
- package/front_end/core/sdk/OverlayModel.ts +23 -23
- package/front_end/core/sdk/PageResourceLoader.ts +1 -1
- package/front_end/core/sdk/PaintProfiler.ts +1 -1
- package/front_end/core/sdk/RemoteObject.ts +2 -2
- package/front_end/core/sdk/Resource.ts +2 -2
- package/front_end/core/sdk/ResourceTreeModel.ts +5 -5
- package/front_end/core/sdk/RuntimeModel.ts +11 -11
- package/front_end/core/sdk/ScreenCaptureModel.ts +3 -3
- package/front_end/core/sdk/ServiceWorkerCacheModel.ts +7 -7
- package/front_end/core/sdk/ServiceWorkerManager.ts +4 -4
- package/front_end/core/sdk/SourceMapManager.ts +1 -1
- package/front_end/core/sdk/TargetManager.ts +2 -2
- package/front_end/core/sdk/TracingManager.ts +1 -1
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshotLoader.ts +1 -1
- package/front_end/entrypoints/inspector_main/InspectorMain.ts +4 -4
- package/front_end/entrypoints/inspector_main/RenderingOptions.ts +1 -1
- package/front_end/entrypoints/js_app/js_app.ts +2 -2
- package/front_end/entrypoints/main/MainImpl.ts +11 -11
- package/front_end/entrypoints/node_app/NodeMain.ts +6 -6
- package/front_end/entrypoints/worker_app/WorkerMain.ts +1 -1
- package/front_end/generated/ARIAProperties.js +1 -1
- package/front_end/generated/InspectorBackendCommands.js +5 -1
- package/front_end/generated/SupportedCSSProperties.js +15 -15
- package/front_end/generated/protocol.d.ts +13 -0
- package/front_end/global_typings/global_defs.d.ts +0 -1
- package/front_end/models/bindings/BreakpointManager.ts +21 -23
- package/front_end/models/bindings/CSSWorkspaceBinding.ts +3 -3
- package/front_end/models/bindings/CompilerScriptMapping.ts +1 -1
- package/front_end/models/bindings/ContentProviderBasedProject.ts +1 -1
- package/front_end/models/bindings/DebuggerLanguagePlugins.ts +2 -2
- package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +3 -3
- package/front_end/models/bindings/DefaultScriptMapping.ts +1 -1
- package/front_end/models/bindings/FileUtils.ts +5 -5
- package/front_end/models/bindings/IgnoreListManager.ts +4 -4
- package/front_end/models/bindings/LiveLocation.ts +9 -0
- package/front_end/models/bindings/PresentationConsoleMessageHelper.ts +2 -1
- package/front_end/models/bindings/ResourceMapping.ts +1 -1
- package/front_end/models/bindings/ResourceScriptMapping.ts +9 -9
- package/front_end/models/bindings/StylesSourceMapping.ts +3 -3
- package/front_end/models/bindings/TempFile.ts +1 -1
- package/front_end/models/emulation/DeviceModeModel.ts +5 -5
- package/front_end/models/emulation/EmulatedDevices.ts +1 -1
- package/front_end/models/extensions/ExtensionPanel.ts +1 -1
- package/front_end/models/extensions/ExtensionServer.ts +8 -8
- package/front_end/models/formatter/SourceFormatter.ts +2 -2
- package/front_end/models/issues_manager/ContrastCheckTrigger.ts +1 -1
- package/front_end/models/issues_manager/DeprecationIssue.ts +7 -7
- package/front_end/models/issues_manager/SourceFrameIssuesManager.ts +3 -3
- package/front_end/models/persistence/Automapping.ts +3 -3
- package/front_end/models/persistence/FileSystemWorkspaceBinding.ts +3 -3
- package/front_end/models/persistence/IsolatedFileSystem.ts +1 -1
- package/front_end/models/persistence/IsolatedFileSystemManager.ts +2 -2
- package/front_end/models/persistence/NetworkPersistenceManager.ts +11 -11
- package/front_end/models/persistence/PersistenceActions.ts +3 -3
- package/front_end/models/persistence/PersistenceImpl.ts +2 -2
- package/front_end/models/persistence/WorkspaceSettingsTab.ts +1 -1
- package/front_end/models/workspace/UISourceCode.ts +2 -2
- package/front_end/models/workspace_diff/WorkspaceDiff.ts +2 -2
- package/front_end/panels/accessibility/AXBreadcrumbsPane.ts +4 -4
- package/front_end/panels/accessibility/AccessibilityNodeView.ts +3 -3
- package/front_end/panels/accessibility/AccessibilitySidebarView.ts +7 -7
- package/front_end/panels/animation/AnimationModel.ts +6 -6
- package/front_end/panels/animation/AnimationTimeline.ts +3 -3
- package/front_end/panels/animation/AnimationUI.ts +3 -3
- package/front_end/panels/application/AppManifestView.ts +4 -4
- package/front_end/panels/application/ApplicationPanelCacheSection.ts +3 -3
- package/front_end/panels/application/ApplicationPanelSidebar.ts +15 -15
- package/front_end/panels/application/BackgroundServiceModel.ts +3 -3
- package/front_end/panels/application/BackgroundServiceView.ts +3 -3
- package/front_end/panels/application/CookieItemsView.ts +5 -5
- package/front_end/panels/application/DOMStorageItemsView.ts +4 -4
- package/front_end/panels/application/DOMStorageModel.ts +4 -4
- package/front_end/panels/application/DatabaseModel.ts +2 -2
- package/front_end/panels/application/DatabaseQueryView.ts +2 -2
- package/front_end/panels/application/DatabaseTableView.ts +1 -1
- package/front_end/panels/application/IndexedDBModel.ts +11 -11
- package/front_end/panels/application/IndexedDBViews.ts +5 -5
- package/front_end/panels/application/OpenedWindowDetailsView.ts +4 -4
- package/front_end/panels/application/ReportingApiView.ts +1 -1
- package/front_end/panels/application/ResourcesPanel.ts +2 -2
- package/front_end/panels/application/ServiceWorkerCacheViews.ts +7 -7
- package/front_end/panels/application/ServiceWorkersView.ts +15 -15
- package/front_end/panels/application/StorageView.ts +5 -5
- package/front_end/panels/application/TrustTokensTreeElement.ts +1 -1
- package/front_end/panels/application/components/BackForwardCacheStrings.ts +5 -1
- package/front_end/panels/application/components/BackForwardCacheView.ts +4 -4
- package/front_end/panels/application/components/FrameDetailsView.ts +3 -3
- package/front_end/panels/application/components/PermissionsPolicySection.ts +2 -2
- package/front_end/panels/browser_debugger/CategorizedBreakpointsSidebarPane.ts +1 -1
- package/front_end/panels/browser_debugger/DOMBreakpointsSidebarPane.ts +8 -7
- package/front_end/panels/browser_debugger/ObjectEventListenersSidebarPane.ts +1 -1
- package/front_end/panels/browser_debugger/XHRBreakpointsSidebarPane.ts +4 -4
- package/front_end/panels/changes/ChangesView.ts +4 -4
- package/front_end/panels/console/ConsoleContextSelector.ts +1 -1
- package/front_end/panels/console/ConsoleFilter.ts +17 -2
- package/front_end/panels/console/ConsoleFormat.ts +5 -4
- package/front_end/panels/console/ConsolePinPane.ts +4 -4
- package/front_end/panels/console/ConsolePrompt.ts +4 -4
- package/front_end/panels/console/ConsoleView.ts +96 -71
- package/front_end/panels/console/ConsoleViewMessage.ts +61 -19
- package/front_end/panels/console/consoleView.css +36 -0
- package/front_end/panels/console_counters/WarningErrorCounter.ts +2 -2
- package/front_end/panels/coverage/CoverageListView.ts +3 -3
- package/front_end/panels/coverage/CoverageModel.ts +3 -3
- package/front_end/panels/coverage/CoverageView.ts +6 -6
- package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +3 -3
- package/front_end/panels/css_overview/CSSOverviewModel.ts +2 -2
- package/front_end/panels/css_overview/CSSOverviewPanel.ts +1 -1
- package/front_end/panels/developer_resources/DeveloperResourcesListView.ts +1 -1
- package/front_end/panels/developer_resources/DeveloperResourcesView.ts +1 -1
- package/front_end/panels/elements/AccessibilityTreeView.ts +5 -5
- package/front_end/panels/elements/ClassesPaneWidget.ts +1 -1
- package/front_end/panels/elements/ColorSwatchPopoverIcon.ts +10 -10
- package/front_end/panels/elements/ComputedStyleWidget.ts +2 -2
- package/front_end/panels/elements/DOMLinkifier.ts +2 -2
- package/front_end/panels/elements/ElementsPanel.ts +19 -19
- package/front_end/panels/elements/ElementsSidebarPane.ts +1 -1
- package/front_end/panels/elements/ElementsTreeElement.ts +26 -25
- package/front_end/panels/elements/ElementsTreeElementHighlighter.ts +1 -1
- package/front_end/panels/elements/ElementsTreeOutline.ts +4 -4
- package/front_end/panels/elements/InspectElementModeController.ts +3 -3
- package/front_end/panels/elements/LayoutSidebarPane.ts +2 -2
- package/front_end/panels/elements/MetricsSidebarPane.ts +2 -2
- package/front_end/panels/elements/StylePropertyHighlighter.ts +1 -1
- package/front_end/panels/elements/StylePropertyTreeElement.ts +16 -16
- package/front_end/panels/elements/StylesSidebarPane.ts +15 -15
- package/front_end/panels/elements/components/AccessibilityTreeNode.ts +1 -1
- package/front_end/panels/elements/components/ElementsBreadcrumbs.ts +8 -8
- package/front_end/panels/elements/elementsPanel.css +1 -0
- package/front_end/panels/elements/elementsTreeOutline.css +6 -1
- package/front_end/panels/emulation/DeviceModeToolbar.ts +1 -1
- package/front_end/panels/emulation/DeviceModeView.ts +2 -2
- package/front_end/panels/emulation/DeviceModeWrapper.ts +4 -4
- package/front_end/panels/emulation/MediaQueryInspector.ts +3 -3
- package/front_end/panels/event_listeners/EventListenersView.ts +3 -3
- package/front_end/panels/input/InputModel.ts +2 -2
- package/front_end/panels/input/InputTimeline.ts +6 -6
- package/front_end/panels/issues/AffectedCookiesView.ts +2 -2
- package/front_end/panels/issues/AffectedDirectivesView.ts +1 -1
- package/front_end/panels/issues/AffectedElementsView.ts +1 -1
- package/front_end/panels/issues/AffectedResourcesView.ts +2 -2
- package/front_end/panels/issues/AttributionReportingIssueDetailsView.ts +1 -1
- package/front_end/panels/issues/ComboBoxOfCheckBoxes.ts +1 -1
- package/front_end/panels/issues/IssueView.ts +1 -1
- package/front_end/panels/issues/components/HideIssuesMenu.ts +1 -1
- package/front_end/panels/layer_viewer/LayerDetailsView.ts +1 -1
- package/front_end/panels/layer_viewer/LayerViewHost.ts +1 -1
- package/front_end/panels/layer_viewer/Layers3DView.ts +7 -7
- package/front_end/panels/layer_viewer/PaintProfilerView.ts +1 -1
- package/front_end/panels/layers/LayerPaintProfilerView.ts +3 -3
- package/front_end/panels/layers/LayerTreeModel.ts +4 -4
- package/front_end/panels/layers/LayersPanel.ts +4 -4
- package/front_end/panels/lighthouse/LighthouseController.ts +1 -1
- package/front_end/panels/lighthouse/LighthousePanel.ts +5 -5
- package/front_end/panels/lighthouse/LighthouseProtocolService.ts +1 -1
- package/front_end/panels/lighthouse/LighthouseReportRenderer.ts +1 -1
- package/front_end/panels/media/MediaModel.ts +1 -1
- package/front_end/panels/media/PlayerListView.ts +1 -1
- package/front_end/panels/mobile_throttling/NetworkThrottlingSelector.ts +1 -1
- package/front_end/panels/network/BinaryResourceView.ts +1 -1
- package/front_end/panels/network/BlockedURLsPane.ts +5 -5
- package/front_end/panels/network/NetworkDataGridNode.ts +1 -1
- package/front_end/panels/network/NetworkItemView.ts +2 -2
- package/front_end/panels/network/NetworkLogView.ts +4 -4
- package/front_end/panels/network/NetworkLogViewColumns.ts +1 -1
- package/front_end/panels/network/NetworkPanel.ts +8 -8
- package/front_end/panels/network/NetworkTimeCalculator.ts +1 -1
- package/front_end/panels/network/RequestHeadersView.ts +4 -3
- package/front_end/panels/network/RequestPayloadView.ts +8 -8
- package/front_end/panels/network/RequestPreviewView.ts +1 -1
- package/front_end/panels/network/RequestResponseView.ts +2 -2
- package/front_end/panels/network/ResourceWebSocketFrameView.ts +1 -1
- package/front_end/panels/performance_monitor/PerformanceMonitor.ts +2 -2
- package/front_end/panels/profiler/CPUProfileView.ts +4 -4
- package/front_end/panels/profiler/HeapProfileView.ts +6 -6
- package/front_end/panels/profiler/HeapProfilerPanel.ts +2 -2
- package/front_end/panels/profiler/HeapSnapshotDataGrids.ts +10 -10
- package/front_end/panels/profiler/HeapSnapshotGridNodes.ts +9 -8
- package/front_end/panels/profiler/HeapSnapshotView.ts +24 -24
- package/front_end/panels/profiler/LiveHeapProfileView.ts +4 -4
- package/front_end/panels/profiler/ProfileSidebarTreeElement.ts +1 -1
- package/front_end/panels/profiler/ProfileView.ts +3 -3
- package/front_end/panels/profiler/ProfilesPanel.ts +3 -3
- package/front_end/panels/protocol_monitor/ProtocolMonitor.ts +3 -3
- package/front_end/panels/screencast/InputModel.ts +3 -3
- package/front_end/panels/screencast/ScreencastView.ts +10 -10
- package/front_end/panels/search/SearchResultsPane.ts +1 -1
- package/front_end/panels/search/SearchView.ts +2 -2
- package/front_end/panels/security/SecurityModel.ts +1 -1
- package/front_end/panels/security/SecurityPanel.ts +2 -2
- package/front_end/panels/sensors/SensorsView.ts +3 -2
- package/front_end/panels/settings/SettingsScreen.ts +5 -5
- package/front_end/panels/settings/components/SyncSection.ts +1 -1
- package/front_end/panels/snippets/SnippetsQuickOpen.ts +1 -1
- package/front_end/panels/sources/BreakpointEditDialog.ts +2 -2
- package/front_end/panels/sources/CallStackSidebarPane.ts +4 -4
- package/front_end/panels/sources/CoveragePlugin.ts +3 -3
- package/front_end/panels/sources/DebuggerPlugin.ts +12 -12
- package/front_end/panels/sources/GoToLineQuickOpen.ts +1 -1
- package/front_end/panels/sources/InplaceFormatterEditorAction.ts +3 -3
- package/front_end/panels/sources/JavaScriptBreakpointsSidebarPane.ts +3 -3
- package/front_end/panels/sources/NavigatorView.ts +6 -6
- package/front_end/panels/sources/OpenFileQuickOpen.ts +2 -2
- package/front_end/panels/sources/OutlineQuickOpen.ts +1 -1
- package/front_end/panels/sources/ScopeChainSidebarPane.ts +3 -3
- package/front_end/panels/sources/ScriptFormatterEditorAction.ts +3 -3
- package/front_end/panels/sources/SearchSourcesView.ts +2 -2
- package/front_end/panels/sources/SourcesNavigator.ts +9 -9
- package/front_end/panels/sources/SourcesPanel.ts +28 -25
- package/front_end/panels/sources/SourcesSearchScope.ts +2 -2
- package/front_end/panels/sources/SourcesView.ts +4 -4
- package/front_end/panels/sources/TabbedEditorContainer.ts +1 -1
- package/front_end/panels/sources/UISourceCodeFrame.ts +2 -2
- package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +4 -4
- package/front_end/panels/timeline/EventsTimelineTreeView.ts +1 -1
- package/front_end/panels/timeline/TimelineController.ts +1 -1
- package/front_end/panels/timeline/TimelineDetailsView.ts +2 -2
- package/front_end/panels/timeline/TimelineEventOverview.ts +2 -2
- package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +3 -5
- package/front_end/panels/timeline/TimelineFlameChartNetworkDataProvider.ts +4 -7
- package/front_end/panels/timeline/TimelineHistoryManager.ts +1 -1
- package/front_end/panels/timeline/TimelineLayersView.ts +1 -1
- package/front_end/panels/timeline/TimelineLoader.ts +2 -2
- package/front_end/panels/timeline/TimelinePaintProfilerView.ts +4 -4
- package/front_end/panels/timeline/TimelinePanel.ts +10 -10
- package/front_end/panels/timeline/TimelineUIUtils.ts +2 -2
- package/front_end/panels/timeline/components/WebVitalsTimeline.ts +2 -2
- package/front_end/panels/web_audio/WebAudioModel.ts +1 -1
- package/front_end/panels/web_audio/WebAudioView.ts +1 -1
- package/front_end/panels/webauthn/WebauthnPane.ts +7 -7
- package/front_end/ui/components/buttons/Button.ts +10 -10
- package/front_end/ui/components/data_grid/DataGrid.ts +14 -14
- package/front_end/ui/components/docs/tree_outline/basic.ts +2 -2
- package/front_end/ui/components/docs/tree_outline/custom-renderers.ts +1 -1
- package/front_end/ui/components/docs/tree_outline/lazy-children.ts +1 -1
- package/front_end/ui/components/helpers/scheduled-render.ts +1 -1
- package/front_end/ui/components/icon_button/Icon.ts +1 -1
- package/front_end/ui/components/issue_counter/IssueCounter.ts +1 -1
- package/front_end/ui/components/issue_counter/IssueLinkIcon.ts +2 -2
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspectorController.ts +2 -2
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspectorPane.ts +5 -2
- package/front_end/ui/components/linkifier/LinkifierImpl.ts +1 -1
- package/front_end/ui/components/panel_feedback/FeedbackButton.ts +1 -1
- package/front_end/ui/components/panel_feedback/PanelFeedback.ts +1 -1
- package/front_end/ui/components/request_link_icon/RequestLinkIcon.ts +3 -3
- package/front_end/ui/components/text_editor/cursor_tooltip.ts +1 -1
- package/front_end/ui/components/text_editor/javascript.ts +2 -2
- package/front_end/ui/components/tree_outline/TreeOutline.ts +8 -8
- package/front_end/ui/legacy/Context.ts +1 -1
- package/front_end/ui/legacy/ContextMenu.ts +1 -1
- package/front_end/ui/legacy/GlassPane.ts +0 -1
- package/front_end/ui/legacy/InspectorView.ts +2 -3
- package/front_end/ui/legacy/PopoverHelper.ts +1 -1
- package/front_end/ui/legacy/ShortcutRegistry.ts +1 -1
- package/front_end/ui/legacy/TabbedPane.ts +2 -2
- package/front_end/ui/legacy/ThrottledWidget.ts +1 -1
- package/front_end/ui/legacy/Toolbar.ts +3 -3
- package/front_end/ui/legacy/Treeoutline.ts +6 -6
- package/front_end/ui/legacy/UIUtils.ts +16 -16
- package/front_end/ui/legacy/ViewManager.ts +9 -9
- package/front_end/ui/legacy/components/color_picker/ContrastOverlay.ts +1 -1
- package/front_end/ui/legacy/components/color_picker/Spectrum.ts +7 -7
- package/front_end/ui/legacy/components/color_picker/spectrum.css +5 -2
- package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +3 -3
- package/front_end/ui/legacy/components/data_grid/DataGrid.ts +2 -2
- package/front_end/ui/legacy/components/data_grid/ShowMoreDataGridNode.ts +3 -3
- package/front_end/ui/legacy/components/inline_editor/CSSAngleEditor.ts +1 -1
- package/front_end/ui/legacy/components/inline_editor/FontEditor.ts +4 -4
- package/front_end/ui/legacy/components/object_ui/CustomPreviewComponent.ts +3 -3
- package/front_end/ui/legacy/components/object_ui/ObjectPopoverHelper.ts +1 -1
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +11 -11
- package/front_end/ui/legacy/components/perf_ui/FilmStripView.ts +8 -8
- package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +10 -19
- package/front_end/ui/legacy/components/perf_ui/GCActionDelegate.ts +1 -1
- package/front_end/ui/legacy/components/perf_ui/LineLevelProfile.ts +1 -1
- package/front_end/ui/legacy/components/perf_ui/LiveHeapProfile.ts +3 -3
- package/front_end/ui/legacy/components/perf_ui/TimelineGrid.ts +2 -4
- package/front_end/ui/legacy/components/perf_ui/TimelineOverviewPane.ts +2 -2
- package/front_end/ui/legacy/components/perf_ui/flameChart.css +8 -0
- package/front_end/ui/legacy/components/quick_open/FilteredListWidget.ts +5 -5
- package/front_end/ui/legacy/components/source_frame/FontView.ts +1 -2
- package/front_end/ui/legacy/components/source_frame/ImageView.ts +3 -4
- package/front_end/ui/legacy/components/source_frame/JSONView.ts +0 -1
- package/front_end/ui/legacy/components/source_frame/ResourceSourceFrame.ts +1 -2
- package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +5 -5
- package/front_end/ui/legacy/components/source_frame/XMLView.ts +0 -2
- package/front_end/ui/legacy/components/utils/ImagePreview.ts +1 -1
- package/front_end/ui/legacy/components/utils/JSPresentationUtils.ts +1 -1
- package/front_end/ui/legacy/components/utils/Linkifier.ts +5 -5
- package/front_end/ui/legacy/components/utils/TargetDetachedDialog.ts +2 -2
- package/front_end/ui/legacy/tabbedPane.css +1 -0
- package/front_end/ui/legacy/theme_support/theme_support_impl.ts +3 -210
- package/front_end/ui/legacy/toolbar.css +1 -0
- package/package.json +1 -1
- package/scripts/component_server/server.js +2 -2
- package/scripts/eslint_rules/tests/check_license_header_test.js +10 -8
- package/front_end/global_typings/intl_display_names.d.ts +0 -111
|
@@ -34,7 +34,6 @@
|
|
|
34
34
|
*/
|
|
35
35
|
|
|
36
36
|
import * as Common from '../../../core/common/common.js';
|
|
37
|
-
import * as Platform from '../../../core/platform/platform.js';
|
|
38
37
|
|
|
39
38
|
import inspectorSyntaxHighlightStyles from '../inspectorSyntaxHighlight.css.legacy.js';
|
|
40
39
|
import inspectorSyntaxHighlightDarkStyles from '../inspectorSyntaxHighlightDark.css.legacy.js';
|
|
@@ -45,33 +44,13 @@ const themeValuesCache = new Map<CSSStyleDeclaration, Map<string, string>>();
|
|
|
45
44
|
|
|
46
45
|
export class ThemeSupport {
|
|
47
46
|
private readonly themeNameInternal: string;
|
|
48
|
-
private themableProperties: Set<string>;
|
|
49
|
-
private readonly cachedThemePatches: Map<string, string>;
|
|
50
|
-
private readonly setting: Common.Settings.Setting<string>;
|
|
51
47
|
private readonly customSheets: Set<string>;
|
|
52
48
|
private readonly computedRoot: () => symbol | CSSStyleDeclaration;
|
|
53
|
-
private injectingStyleSheet?: boolean;
|
|
54
49
|
|
|
55
50
|
private constructor(setting: Common.Settings.Setting<string>) {
|
|
56
51
|
const systemPreferredTheme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'default';
|
|
57
52
|
this.themeNameInternal = setting.get() === 'systemPreferred' ? systemPreferredTheme : setting.get();
|
|
58
|
-
|
|
59
|
-
'color',
|
|
60
|
-
'box-shadow',
|
|
61
|
-
'text-shadow',
|
|
62
|
-
'outline-color',
|
|
63
|
-
'background-image',
|
|
64
|
-
'background-color',
|
|
65
|
-
'border-left-color',
|
|
66
|
-
'border-right-color',
|
|
67
|
-
'border-top-color',
|
|
68
|
-
'border-bottom-color',
|
|
69
|
-
'-webkit-border-image',
|
|
70
|
-
'fill',
|
|
71
|
-
'stroke',
|
|
72
|
-
]);
|
|
73
|
-
this.cachedThemePatches = new Map();
|
|
74
|
-
this.setting = setting;
|
|
53
|
+
|
|
75
54
|
this.customSheets = new Set();
|
|
76
55
|
this.computedRoot = Common.Lazy.lazy(() => window.getComputedStyle(document.documentElement));
|
|
77
56
|
}
|
|
@@ -139,12 +118,10 @@ export class ThemeSupport {
|
|
|
139
118
|
}
|
|
140
119
|
|
|
141
120
|
injectHighlightStyleSheets(element: Element|ShadowRoot): void {
|
|
142
|
-
this.injectingStyleSheet = true;
|
|
143
121
|
this.appendStyle(element, inspectorSyntaxHighlightStyles);
|
|
144
122
|
if (this.themeNameInternal === 'dark') {
|
|
145
123
|
this.appendStyle(element, inspectorSyntaxHighlightDarkStyles);
|
|
146
124
|
}
|
|
147
|
-
this.injectingStyleSheet = false;
|
|
148
125
|
}
|
|
149
126
|
|
|
150
127
|
/**
|
|
@@ -174,195 +151,11 @@ export class ThemeSupport {
|
|
|
174
151
|
}
|
|
175
152
|
|
|
176
153
|
applyTheme(document: Document): void {
|
|
177
|
-
if (!this.hasTheme() || this.isForcedColorsMode()) {
|
|
178
|
-
return;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
if (this.themeNameInternal === 'dark') {
|
|
182
|
-
document.documentElement.classList.add('-theme-with-dark-background');
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
const styleSheets = document.styleSheets;
|
|
186
|
-
const result = [];
|
|
187
|
-
for (let i = 0; i < styleSheets.length; ++i) {
|
|
188
|
-
const href = styleSheets[i].href;
|
|
189
|
-
if (!href) {
|
|
190
|
-
continue;
|
|
191
|
-
}
|
|
192
|
-
result.push(this.patchForTheme(href, (styleSheets[i] as CSSStyleSheet)));
|
|
193
|
-
}
|
|
194
|
-
result.push('/*# sourceURL=inspector.css.theme */');
|
|
195
|
-
|
|
196
|
-
const styleElement = document.createElement('style');
|
|
197
|
-
styleElement.textContent = result.join('\n');
|
|
198
|
-
document.head.appendChild(styleElement);
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
themeStyleSheet(id: string, text: string): string {
|
|
202
|
-
if (!this.hasTheme() || this.injectingStyleSheet || this.isForcedColorsMode()) {
|
|
203
|
-
return '';
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
let patch = this.cachedThemePatches.get(id);
|
|
207
|
-
if (!patch) {
|
|
208
|
-
const styleElement = document.createElement('style');
|
|
209
|
-
styleElement.textContent = text;
|
|
210
|
-
document.body.appendChild(styleElement);
|
|
211
|
-
|
|
212
|
-
const {sheet} = styleElement;
|
|
213
|
-
if (!sheet) {
|
|
214
|
-
throw new Error('No sheet in stylesheet object');
|
|
215
|
-
}
|
|
216
|
-
patch = this.patchForTheme(id, sheet);
|
|
217
|
-
document.body.removeChild(styleElement);
|
|
218
|
-
}
|
|
219
|
-
return patch;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
private patchForTheme(id: string, styleSheet: CSSStyleSheet): string {
|
|
223
|
-
const cached = this.cachedThemePatches.get(id);
|
|
224
|
-
if (cached) {
|
|
225
|
-
return cached;
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
try {
|
|
229
|
-
const rules = styleSheet.cssRules;
|
|
230
|
-
const result = [];
|
|
231
|
-
for (let j = 0; j < rules.length; ++j) {
|
|
232
|
-
const rule = rules[j];
|
|
233
|
-
if (rule instanceof CSSImportRule) {
|
|
234
|
-
result.push(this.patchForTheme(rule.styleSheet.href || '', rule.styleSheet));
|
|
235
|
-
continue;
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
if (!(rule instanceof CSSStyleRule)) {
|
|
239
|
-
continue;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
const output: string[] = [];
|
|
243
|
-
const style = rule.style;
|
|
244
|
-
const selectorText = rule.selectorText;
|
|
245
|
-
for (let i = 0; style && i < style.length; ++i) {
|
|
246
|
-
this.patchProperty(selectorText, style, style[i], output);
|
|
247
|
-
}
|
|
248
|
-
if (output.length) {
|
|
249
|
-
result.push(rule.selectorText + '{' + output.join('') + '}');
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
const fullText = result.join('\n');
|
|
254
|
-
this.cachedThemePatches.set(id, fullText);
|
|
255
|
-
return fullText;
|
|
256
|
-
} catch (e) {
|
|
257
|
-
this.setting.set('default');
|
|
258
|
-
return '';
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
/**
|
|
263
|
-
* Theming API is primarily targeted at making dark theme look good.
|
|
264
|
-
* - If rule has ".-theme-preserve" in selector, it won't be affected.
|
|
265
|
-
* - One can create specializations for dark themes via body.-theme-with-dark-background selector in host context.
|
|
266
|
-
*/
|
|
267
|
-
private patchProperty(selectorText: string, style: CSSStyleDeclaration, name: string, output: string[]): void {
|
|
268
|
-
if (!this.themableProperties.has(name)) {
|
|
269
|
-
return;
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
const value = style.getPropertyValue(name);
|
|
273
|
-
if (!value || value === 'none' || value === 'inherit' || value === 'initial' || value === 'transparent') {
|
|
274
|
-
return;
|
|
275
|
-
}
|
|
276
|
-
if (name === 'background-image' && value.indexOf('gradient') === -1) {
|
|
277
|
-
return;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
if (selectorText.indexOf('-theme-') !== -1) {
|
|
154
|
+
if (!this.hasTheme() || this.isForcedColorsMode() || this.themeNameInternal !== 'dark') {
|
|
281
155
|
return;
|
|
282
156
|
}
|
|
283
157
|
|
|
284
|
-
|
|
285
|
-
if (name.indexOf('background') === 0 || name.indexOf('border') === 0) {
|
|
286
|
-
colorUsage |= ThemeSupport.ColorUsage.Background;
|
|
287
|
-
}
|
|
288
|
-
if (name.indexOf('background') === -1) {
|
|
289
|
-
colorUsage |= ThemeSupport.ColorUsage.Foreground;
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
output.push(name);
|
|
293
|
-
output.push(':');
|
|
294
|
-
if (/^var\(.*\)$/.test(value)) {
|
|
295
|
-
// Don't translate CSS variables.
|
|
296
|
-
output.push(value);
|
|
297
|
-
} else {
|
|
298
|
-
const items = value.replace(Common.Color.Regex, '\0$1\0').split('\0');
|
|
299
|
-
for (const item of items) {
|
|
300
|
-
output.push(this.patchColorText(item, (colorUsage as number)));
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
if (style.getPropertyPriority(name)) {
|
|
304
|
-
output.push(' !important');
|
|
305
|
-
}
|
|
306
|
-
output.push(';');
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
/**
|
|
310
|
-
* This legacy function has been supeseded by CSS custom properties. Wherever possible, please use
|
|
311
|
-
* the values declared in global stylesheets.
|
|
312
|
-
*
|
|
313
|
-
* @deprecated
|
|
314
|
-
*/
|
|
315
|
-
patchColorText(text: string, colorUsage: number): string {
|
|
316
|
-
const color = Common.Color.Color.parse(text);
|
|
317
|
-
if (!color) {
|
|
318
|
-
return text;
|
|
319
|
-
}
|
|
320
|
-
const outColor = this.patchColor(color, colorUsage);
|
|
321
|
-
let outText = outColor.asString(null);
|
|
322
|
-
if (!outText) {
|
|
323
|
-
outText = outColor.asString(outColor.hasAlpha() ? Common.Color.Format.RGBA : Common.Color.Format.RGB);
|
|
324
|
-
}
|
|
325
|
-
return outText || text;
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
/**
|
|
329
|
-
* This legacy function has been supeseded by CSS custom properties. Wherever possible, please use
|
|
330
|
-
* the values declared in global stylesheets.
|
|
331
|
-
*
|
|
332
|
-
* @deprecated
|
|
333
|
-
*/
|
|
334
|
-
patchColor(color: Common.Color.Color, colorUsage: number): Common.Color.Color {
|
|
335
|
-
const hsla = color.hsla();
|
|
336
|
-
this.patchHSLA(hsla, colorUsage);
|
|
337
|
-
|
|
338
|
-
const rgba: number[] = [];
|
|
339
|
-
Common.Color.Color.hsl2rgb(hsla, rgba);
|
|
340
|
-
return new Common.Color.Color(rgba, color.format());
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
private patchHSLA(hsla: number[], colorUsage: number): void {
|
|
344
|
-
const hue = hsla[0];
|
|
345
|
-
const sat = hsla[1];
|
|
346
|
-
let lit: number = hsla[2];
|
|
347
|
-
const alpha = hsla[3];
|
|
348
|
-
|
|
349
|
-
switch (this.themeNameInternal) {
|
|
350
|
-
case 'dark': {
|
|
351
|
-
const minCap = colorUsage & ThemeSupport.ColorUsage.Background ? 0.14 : 0;
|
|
352
|
-
const maxCap = colorUsage & ThemeSupport.ColorUsage.Foreground ? 0.9 : 1;
|
|
353
|
-
lit = 1 - lit;
|
|
354
|
-
if (lit < minCap * 2) {
|
|
355
|
-
lit = minCap + lit / 2;
|
|
356
|
-
} else if (lit > 2 * maxCap - 1) {
|
|
357
|
-
lit = maxCap - 1 / 2 + lit / 2;
|
|
358
|
-
}
|
|
359
|
-
break;
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
hsla[0] = Platform.NumberUtilities.clamp(hue, 0, 1);
|
|
363
|
-
hsla[1] = Platform.NumberUtilities.clamp(sat, 0, 1);
|
|
364
|
-
hsla[2] = Platform.NumberUtilities.clamp(lit, 0, 1);
|
|
365
|
-
hsla[3] = Platform.NumberUtilities.clamp(alpha, 0, 1);
|
|
158
|
+
document.documentElement.classList.add('-theme-with-dark-background');
|
|
366
159
|
}
|
|
367
160
|
}
|
|
368
161
|
export namespace ThemeSupport {
|
package/package.json
CHANGED
|
@@ -150,8 +150,8 @@ function createServerIndexFile(componentNames) {
|
|
|
150
150
|
<meta charset="UTF-8" />
|
|
151
151
|
<meta name="viewport" content="width=device-width" />
|
|
152
152
|
<title>DevTools components</title>
|
|
153
|
-
<link rel="stylesheet" href="
|
|
154
|
-
<link rel="stylesheet" href="
|
|
153
|
+
<link rel="stylesheet" href="${sharedResourcesBase}front_end/ui/legacy/themeColors.css" />
|
|
154
|
+
<link rel="stylesheet" href="${sharedResourcesBase}front_end/ui/components/docs/component_docs_styles.css" />
|
|
155
155
|
</head>
|
|
156
156
|
<body id="index-page">
|
|
157
157
|
<h1>DevTools components</h1>
|
|
@@ -9,6 +9,8 @@ const ruleTester = new (require('eslint').RuleTester)({
|
|
|
9
9
|
parser: require.resolve('@typescript-eslint/parser'),
|
|
10
10
|
});
|
|
11
11
|
|
|
12
|
+
const CURRENT_YEAR = new Date().getFullYear();
|
|
13
|
+
|
|
12
14
|
ruleTester.run('check_license_header', rule, {
|
|
13
15
|
valid: [
|
|
14
16
|
{
|
|
@@ -116,7 +118,7 @@ main()
|
|
|
116
118
|
code: 'import * as Action from \'./Action.js\';',
|
|
117
119
|
filename: 'front_end/ui/ui.js',
|
|
118
120
|
errors: [{message: 'Missing license header'}],
|
|
119
|
-
output: `// Copyright
|
|
121
|
+
output: `// Copyright ${CURRENT_YEAR} The Chromium Authors. All rights reserved.
|
|
120
122
|
// Use of this source code is governed by a BSD-style license that can be
|
|
121
123
|
// found in the LICENSE file.
|
|
122
124
|
|
|
@@ -131,7 +133,7 @@ import * as Action from './Action.js';
|
|
|
131
133
|
filename: 'front_end/ui/ui.js',
|
|
132
134
|
errors: [{message: 'Incorrect line license header'}],
|
|
133
135
|
output: `
|
|
134
|
-
// Copyright
|
|
136
|
+
// Copyright ${CURRENT_YEAR} The Chromium Authors. All rights reserved.
|
|
135
137
|
// Use of this source code is governed by a BSD-style license that can be
|
|
136
138
|
// found in the LICENSE file.
|
|
137
139
|
|
|
@@ -147,7 +149,7 @@ import * as Action from './Action.js';
|
|
|
147
149
|
(async function() {})();`,
|
|
148
150
|
filename: 'test/webtests/http/tests/devtools/a11y-axe-core/sources/call-stack-a11y-test.js',
|
|
149
151
|
errors: [{message: 'Incorrect line license header'}],
|
|
150
|
-
output: `// Copyright
|
|
152
|
+
output: `// Copyright ${CURRENT_YEAR} The Chromium Authors. All rights reserved.
|
|
151
153
|
// Use of this source code is governed by a BSD-style license that can be
|
|
152
154
|
// found in the LICENSE file.
|
|
153
155
|
|
|
@@ -168,7 +170,7 @@ import * as Action from './Action.js';
|
|
|
168
170
|
filename: 'front_end/ui/ui.js',
|
|
169
171
|
errors: [{message: 'Incorrect line license header'}],
|
|
170
172
|
output: `
|
|
171
|
-
// Copyright
|
|
173
|
+
// Copyright ${CURRENT_YEAR} The Chromium Authors. All rights reserved.
|
|
172
174
|
// Use of this source code is governed by a BSD-style license that can be
|
|
173
175
|
// found in the LICENSE file.
|
|
174
176
|
|
|
@@ -191,7 +193,7 @@ import * as Action from './Action.js';
|
|
|
191
193
|
filename: 'front_end/ui/ui.js',
|
|
192
194
|
errors: [{message: 'Incorrect block license header'}],
|
|
193
195
|
output: `
|
|
194
|
-
// Copyright
|
|
196
|
+
// Copyright ${CURRENT_YEAR} The Chromium Authors. All rights reserved.
|
|
195
197
|
// Use of this source code is governed by a BSD-style license that can be
|
|
196
198
|
// found in the LICENSE file.
|
|
197
199
|
|
|
@@ -225,7 +227,7 @@ interface String {
|
|
|
225
227
|
filename: 'front_end/legacy/legacy-defs.d.ts',
|
|
226
228
|
errors: [{message: 'Missing license header'}],
|
|
227
229
|
output: `
|
|
228
|
-
// Copyright
|
|
230
|
+
// Copyright ${CURRENT_YEAR} The Chromium Authors. All rights reserved.
|
|
229
231
|
// Use of this source code is governed by a BSD-style license that can be
|
|
230
232
|
// found in the LICENSE file.
|
|
231
233
|
|
|
@@ -258,7 +260,7 @@ main()
|
|
|
258
260
|
errors: [{message: 'Missing license header'}],
|
|
259
261
|
output: `#!/usr/bin/env node
|
|
260
262
|
|
|
261
|
-
// Copyright
|
|
263
|
+
// Copyright ${CURRENT_YEAR} The Chromium Authors. All rights reserved.
|
|
262
264
|
// Use of this source code is governed by a BSD-style license that can be
|
|
263
265
|
// found in the LICENSE file.
|
|
264
266
|
|
|
@@ -279,7 +281,7 @@ main()
|
|
|
279
281
|
errors: [{message: 'Incorrect line license header'}],
|
|
280
282
|
output: `#!/usr/bin/env node
|
|
281
283
|
|
|
282
|
-
// Copyright
|
|
284
|
+
// Copyright ${CURRENT_YEAR} The Chromium Authors. All rights reserved.
|
|
283
285
|
// Use of this source code is governed by a BSD-style license that can be
|
|
284
286
|
// found in the LICENSE file.
|
|
285
287
|
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
declare namespace Intl {
|
|
2
|
-
/**
|
|
3
|
-
* An object with properties reflecting the locale
|
|
4
|
-
* and styles options computed during initialization
|
|
5
|
-
* of the `Intl.DisplayNames` object
|
|
6
|
-
*
|
|
7
|
-
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames/resolvedOptions#Description).
|
|
8
|
-
*
|
|
9
|
-
* [Specification](https://tc39.es/ecma402/#sec-intl-displaynames-constructor)
|
|
10
|
-
*/
|
|
11
|
-
interface DisplayNamesOptions {
|
|
12
|
-
localeMatcher: RelativeTimeFormatLocaleMatcher;
|
|
13
|
-
style: RelativeTimeFormatStyle;
|
|
14
|
-
type: 'language'|'region'|'script'|'currency';
|
|
15
|
-
fallback: 'code'|'none';
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
interface DisplayNames {
|
|
19
|
-
/**
|
|
20
|
-
* Receives a code and returns a string based on the locale and options provided when instantiating
|
|
21
|
-
* [`Intl.DisplayNames()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames)
|
|
22
|
-
*
|
|
23
|
-
* @param code The `code` to provide depends on the `type`:
|
|
24
|
-
* - If the type is "region", code should be either an [ISO-3166 two letters region code](https://www.iso.org/iso-3166-country-codes.html),
|
|
25
|
-
* or a [three digits UN M49 Geographic Regions](https://unstats.un.org/unsd/methodology/m49/).
|
|
26
|
-
* - If the type is "script", code should be an [ISO-15924 four letters script code](https://unicode.org/iso15924/iso15924-codes.html).
|
|
27
|
-
* - If the type is "language", code should be a `languageCode` ["-" `scriptCode`] ["-" `regionCode` ] *("-" `variant` )
|
|
28
|
-
* subsequence of the unicode_language_id grammar in [UTS 35's Unicode Language and Locale Identifiers grammar](https://unicode.org/reports/tr35/#Unicode_language_identifier).
|
|
29
|
-
* `languageCode` is either a two letters ISO 639-1 language code or a three letters ISO 639-2 language code.
|
|
30
|
-
* - If the type is "currency", code should be a [3-letter ISO 4217 currency code](https://www.iso.org/iso-4217-currency-codes.html).
|
|
31
|
-
*
|
|
32
|
-
* @returns A language-specific formatted string.
|
|
33
|
-
*
|
|
34
|
-
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames/of).
|
|
35
|
-
*
|
|
36
|
-
* [Specification](https://tc39.es/ecma402/#sec-Intl.DisplayNames.prototype.of).
|
|
37
|
-
*/
|
|
38
|
-
of(code: string): string;
|
|
39
|
-
/**
|
|
40
|
-
* Returns a new object with properties reflecting the locale and style formatting options computed during the construction of the current
|
|
41
|
-
* [`Intl/DisplayNames`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames) object.
|
|
42
|
-
*
|
|
43
|
-
* @returns An object with properties reflecting the locale and formatting options computed during the construction of the
|
|
44
|
-
* given [`Intl/DisplayNames`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames) object.
|
|
45
|
-
*
|
|
46
|
-
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames/resolvedOptions).
|
|
47
|
-
*
|
|
48
|
-
* [Specification](https://tc39.es/ecma402/#sec-Intl.DisplayNames.prototype.resolvedOptions)
|
|
49
|
-
*/
|
|
50
|
-
resolvedOptions(): DisplayNamesOptions;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* The [`Intl.DisplayNames()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames)
|
|
55
|
-
* object enables the consistent translation of language, region and script display names.
|
|
56
|
-
*
|
|
57
|
-
* Part of [Intl object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl)
|
|
58
|
-
* namespace and the [ECMAScript Internationalization API](https://www.ecma-international.org/publications/standards/Ecma-402.htm).
|
|
59
|
-
*
|
|
60
|
-
* [Compatibility](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames#browser_compatibility).
|
|
61
|
-
*/
|
|
62
|
-
const DisplayNames: {
|
|
63
|
-
prototype: DisplayNames;
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Constructor creates [`Intl.DisplayNames`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames)
|
|
67
|
-
* objects that enable the consistent translation of language, region and script display names.
|
|
68
|
-
*
|
|
69
|
-
* @param locales A string with a BCP 47 language tag, or an array of such strings.
|
|
70
|
-
* For the general form and interpretation of the `locales` argument, see the [Intl](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation)
|
|
71
|
-
* page. The following Unicode extension key is allowed:
|
|
72
|
-
* - `nu` The numbering system to be used. Possible values include: `"arab"`, `"arabext"`, `"bali"`, `"beng"`, `"deva"`, `"fullwide"`, `"gujr"`, `"guru"`, `"hanidec"`, `"khmr"`, `"knda"`, `"laoo"`, `"latn"`, `"limb"`, `"mlym"`, `"mong"`, `"mymr"`, `"orya"`, `"tamldec"`, `"telu"`, `"thai"`, `"tibt"`.
|
|
73
|
-
*
|
|
74
|
-
* @param options An object with some or all of the following properties:
|
|
75
|
-
* - `localeMatcher` The locale matching algorithm to use. Possible values are `"lookup"` and `"best fit"`; the default is `"best fit"`.
|
|
76
|
-
* For information about this option, see the [Intl](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation) page.
|
|
77
|
-
* - `style` The formatting style to use, the default is `"long"`. `"narrow"` `"short"` `"long"`
|
|
78
|
-
* - `type` The type to use. `"language"` `"region"` `"script"` `"currency"`
|
|
79
|
-
* - `fallback` The fallback to use, the default is `"code"`. `"code"` `"none"`
|
|
80
|
-
*
|
|
81
|
-
* @returns [Intl.DisplayNames](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames) object.
|
|
82
|
-
*
|
|
83
|
-
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames/DisplayNames).
|
|
84
|
-
*
|
|
85
|
-
* [Specification](https://tc39.es/ecma402/#sec-intl-displaynames-constructor).
|
|
86
|
-
*/
|
|
87
|
-
new (locales?: UnicodeBCP47LocaleIdentifier|UnicodeBCP47LocaleIdentifier[], options?: Partial<DisplayNamesOptions>):
|
|
88
|
-
DisplayNames;
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* Returns an array containing those of the provided locales that are supported in display names without having to fall back to the runtime's default locale.
|
|
92
|
-
*
|
|
93
|
-
* @param locales A string with a BCP 47 language tag, or an array of such strings.
|
|
94
|
-
* For the general form and interpretation of the `locales` argument, see the [Intl](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation)
|
|
95
|
-
* page.
|
|
96
|
-
*
|
|
97
|
-
* @param options An object that may have the following property:
|
|
98
|
-
* - `localeMatcher` The locale matching algorithm to use. Possible values are `"lookup"` and `"best fit"`; the default is `"best fit"`.
|
|
99
|
-
* For information about this option, see the [Intl](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation) page.
|
|
100
|
-
*
|
|
101
|
-
* @returns An array of strings representing a subset of the given locale tags that are supported in display names without having to fall back to the runtime's default locale.
|
|
102
|
-
*
|
|
103
|
-
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames/supportedLocalesOf).
|
|
104
|
-
*
|
|
105
|
-
* [Specification](https://tc39.es/ecma402/#sec-Intl.DisplayNames.supportedLocalesOf).
|
|
106
|
-
*/
|
|
107
|
-
supportedLocalesOf(
|
|
108
|
-
locales: UnicodeBCP47LocaleIdentifier|UnicodeBCP47LocaleIdentifier[],
|
|
109
|
-
options: {localeMatcher: RelativeTimeFormatLocaleMatcher}): UnicodeBCP47LocaleIdentifier[];
|
|
110
|
-
};
|
|
111
|
-
}
|