chrome-devtools-frontend 1.0.998281 → 1.0.999791

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/.clang-format +1 -0
  2. package/front_end/core/common/Color.ts +9 -1
  3. package/front_end/core/common/Object.ts +2 -1
  4. package/front_end/core/common/Settings.ts +13 -1
  5. package/front_end/core/dom_extension/DOMExtension.ts +0 -10
  6. package/front_end/core/host/InspectorFrontendHost.ts +4 -1
  7. package/front_end/core/host/UserMetrics.ts +2 -1
  8. package/front_end/core/i18n/locales/en-US.json +4 -10
  9. package/front_end/core/i18n/locales/en-XL.json +4 -10
  10. package/front_end/core/sdk/CSSProperty.ts +6 -7
  11. package/front_end/core/sdk/ChildTargetManager.ts +0 -3
  12. package/front_end/core/sdk/ConsoleModel.ts +2 -1
  13. package/front_end/core/sdk/DebuggerModel.ts +4 -30
  14. package/front_end/core/sdk/NetworkManager.ts +3 -1
  15. package/front_end/core/sdk/RuntimeModel.ts +7 -1
  16. package/front_end/core/sdk/SourceMapManager.ts +10 -1
  17. package/front_end/entrypoints/formatter_worker/FormatterWorker.ts +5 -1
  18. package/front_end/entrypoints/inspector_main/RenderingOptions.ts +31 -0
  19. package/front_end/entrypoints/inspector_main/inspector_main-meta.ts +15 -0
  20. package/front_end/entrypoints/lighthouse_worker/LighthouseWorkerService.ts +6 -0
  21. package/front_end/generated/InspectorBackendCommands.js +0 -1
  22. package/front_end/generated/protocol.ts +0 -1
  23. package/front_end/legacy/legacy-defs.d.ts +2 -2
  24. package/front_end/models/formatter/ScriptFormatter.ts +3 -1
  25. package/front_end/models/issues_manager/DeprecationIssue.ts +202 -201
  26. package/front_end/models/issues_manager/SourceFrameIssuesManager.ts +5 -1
  27. package/front_end/models/text_utils/CodeMirrorUtils.ts +14 -17
  28. package/front_end/models/timeline_model/TimelineModel.ts +1 -1
  29. package/front_end/panels/application/IndexedDBViews.ts +5 -2
  30. package/front_end/panels/console/ConsoleView.ts +9 -1
  31. package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +3 -1
  32. package/front_end/panels/elements/PropertiesWidget.ts +0 -1
  33. package/front_end/panels/elements/StylesSidebarPane.ts +7 -1
  34. package/front_end/panels/lighthouse/LighthouseController.ts +19 -12
  35. package/front_end/panels/lighthouse/LighthousePanel.ts +3 -2
  36. package/front_end/panels/lighthouse/LighthouseStartView.ts +10 -4
  37. package/front_end/panels/lighthouse/LighthouseStartViewFR.ts +50 -48
  38. package/front_end/panels/lighthouse/LighthouseTimespanView.ts +9 -2
  39. package/front_end/panels/lighthouse/lighthouseDialog.css +5 -0
  40. package/front_end/panels/lighthouse/lighthouseStartView.css +3 -3
  41. package/front_end/panels/mobile_throttling/ThrottlingManager.ts +3 -1
  42. package/front_end/panels/network/NetworkLogView.ts +5 -1
  43. package/front_end/panels/network/NetworkLogViewColumns.ts +3 -1
  44. package/front_end/panels/network/RequestTimingView.ts +1 -1
  45. package/front_end/panels/profiler/HeapSnapshotDataGrids.ts +8 -1
  46. package/front_end/panels/profiler/HeapSnapshotGridNodes.ts +3 -1
  47. package/front_end/panels/profiler/HeapSnapshotView.ts +14 -2
  48. package/front_end/panels/sources/SourcesPanel.ts +7 -1
  49. package/front_end/panels/timeline/TimelineController.ts +1 -1
  50. package/front_end/panels/timeline/TimelineEventOverview.ts +0 -60
  51. package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +1 -9
  52. package/front_end/panels/timeline/TimelineFlameChartView.ts +4 -1
  53. package/front_end/panels/timeline/TimelineHistoryManager.ts +5 -2
  54. package/front_end/panels/timeline/TimelinePanel.ts +9 -2
  55. package/front_end/panels/timeline/TimelineUIUtils.ts +7 -34
  56. package/front_end/panels/timeline/timeline-legacy.ts +0 -3
  57. package/front_end/panels/timeline/timelinePanel.css +0 -6
  58. package/front_end/panels/web_audio/graph_visualizer/GraphView.ts +3 -1
  59. package/front_end/panels/web_audio/graph_visualizer/NodeRendererUtility.ts +8 -1
  60. package/front_end/panels/web_audio/graph_visualizer/NodeView.ts +13 -1
  61. package/front_end/panels/web_audio/web_audio.ts +8 -1
  62. package/front_end/ui/components/buttons/button.css +16 -3
  63. package/front_end/ui/components/data_grid/DataGrid.ts +9 -1
  64. package/front_end/ui/components/docs/button/basic.ts +10 -0
  65. package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspector.ts +11 -3
  66. package/front_end/ui/components/linear_memory_inspector/ValueInterpreterDisplay.ts +12 -1
  67. package/front_end/ui/components/tree_outline/TreeOutline.ts +16 -11
  68. package/front_end/ui/legacy/ActionRegistration.ts +1 -0
  69. package/front_end/ui/legacy/Fragment.ts +2 -2
  70. package/front_end/ui/legacy/Toolbar.ts +4 -0
  71. package/front_end/ui/legacy/ViewManager.ts +12 -1
  72. package/front_end/ui/legacy/XLink.ts +6 -1
  73. package/front_end/ui/legacy/components/inline_editor/CSSAngle.ts +8 -1
  74. package/front_end/ui/legacy/components/inline_editor/CSSAngleEditor.ts +7 -1
  75. package/package.json +1 -1
  76. package/scripts/reformat-clang-js-ts.js +60 -0
@@ -57,7 +57,15 @@ import {Events, PerformanceModel} from './PerformanceModel.js';
57
57
  import type {Client} from './TimelineController.js';
58
58
  import {TimelineController} from './TimelineController.js';
59
59
  import type {TimelineEventOverview} from './TimelineEventOverview.js';
60
- import {TimelineEventOverviewCoverage, TimelineEventOverviewCPUActivity, TimelineEventOverviewFrames, TimelineEventOverviewInput, TimelineEventOverviewMemory, TimelineEventOverviewNetwork, TimelineEventOverviewResponsiveness, TimelineFilmStripOverview} from './TimelineEventOverview.js';
60
+ import {
61
+ TimelineEventOverviewCoverage,
62
+ TimelineEventOverviewCPUActivity,
63
+ TimelineEventOverviewInput,
64
+ TimelineEventOverviewMemory,
65
+ TimelineEventOverviewNetwork,
66
+ TimelineEventOverviewResponsiveness,
67
+ TimelineFilmStripOverview,
68
+ } from './TimelineEventOverview.js';
61
69
  import {TimelineFlameChartView} from './TimelineFlameChartView.js';
62
70
  import {TimelineHistoryManager} from './TimelineHistoryManager.js';
63
71
  import {TimelineLoader} from './TimelineLoader.js';
@@ -701,7 +709,6 @@ export class TimelinePanel extends UI.Panel.Panel implements Client, TimelineMod
701
709
  if (Root.Runtime.experiments.isEnabled('inputEventsOnTimelineOverview')) {
702
710
  this.overviewControls.push(new TimelineEventOverviewInput());
703
711
  }
704
- this.overviewControls.push(new TimelineEventOverviewFrames());
705
712
  this.overviewControls.push(new TimelineEventOverviewCPUActivity());
706
713
  this.overviewControls.push(new TimelineEventOverviewNetwork());
707
714
  if (this.showScreenshotsSetting.get() && this.performanceModel &&
@@ -1069,10 +1069,6 @@ const UIStrings = {
1069
1069
  */
1070
1070
  frame: 'Frame',
1071
1071
  /**
1072
- *@description Text in Timeline Event Overview of the Performance panel
1073
- */
1074
- fps: 'FPS',
1075
- /**
1076
1072
  *@description Text in Timeline UIUtils of the Performance panel
1077
1073
  */
1078
1074
  cpuTime: 'CPU time',
@@ -1682,8 +1678,7 @@ export class TimelineUIUtils {
1682
1678
  }
1683
1679
  }
1684
1680
 
1685
- static async buildDetailsTextForTraceEvent(event: SDK.TracingModel.Event, target: SDK.Target.Target|null):
1686
- Promise<string|null> {
1681
+ static async buildDetailsTextForTraceEvent(event: SDK.TracingModel.Event): Promise<string|null> {
1687
1682
  const recordType = TimelineModel.TimelineModel.RecordType;
1688
1683
  let detailsText;
1689
1684
  const eventData = event.args['data'];
@@ -1696,9 +1691,9 @@ export class TimelineUIUtils {
1696
1691
  break;
1697
1692
  }
1698
1693
  case recordType.FunctionCall:
1699
- if (eventData) {
1700
- detailsText =
1701
- await linkifyLocationAsText(eventData['scriptId'], eventData['lineNumber'], eventData['columnNumber']);
1694
+ if (eventData && eventData['url'] && eventData['lineNumber'] !== undefined &&
1695
+ eventData['columnNumber'] !== undefined) {
1696
+ detailsText = eventData.url + ':' + (eventData.lineNumber + 1) + ':' + (eventData.columnNumber + 1);
1702
1697
  }
1703
1698
  break;
1704
1699
  case recordType.JSFrame:
@@ -1804,33 +1799,13 @@ export class TimelineUIUtils {
1804
1799
 
1805
1800
  return detailsText;
1806
1801
 
1807
- async function linkifyLocationAsText(
1808
- scriptId: Protocol.Runtime.ScriptId, lineNumber: number, columnNumber: number): Promise<string|null> {
1809
- const debuggerModel = target ? target.model(SDK.DebuggerModel.DebuggerModel) : null;
1810
- if (!target || target.isDisposed() || !scriptId || !debuggerModel) {
1811
- return null;
1812
- }
1813
- const rawLocation = debuggerModel.createRawLocationByScriptId(scriptId, lineNumber, columnNumber);
1814
- if (!rawLocation) {
1815
- return null;
1816
- }
1817
- const uiLocation =
1818
- await Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance().rawLocationToUILocation(
1819
- rawLocation);
1820
- return uiLocation ? uiLocation.linkText(false /* skipTrim*/, true /* showColumnNumber*/) : null;
1821
- }
1822
-
1823
1802
  async function linkifyTopCallFrameAsText(): Promise<string|null> {
1824
1803
  const frame = TimelineModel.TimelineModel.TimelineData.forEvent(event).topFrame();
1825
1804
  if (!frame) {
1826
1805
  return null;
1827
1806
  }
1828
- let text: string|(string | null) =
1829
- await linkifyLocationAsText(frame.scriptId, frame.lineNumber, frame.columnNumber);
1830
- if (!text) {
1831
- text = frame.url + ':' + (frame.lineNumber + 1) + ':' + (frame.columnNumber + 1);
1832
- }
1833
- return text;
1807
+
1808
+ return frame.url + ':' + (frame.lineNumber + 1) + ':' + (frame.columnNumber + 1);
1834
1809
  }
1835
1810
  }
1836
1811
 
@@ -1859,7 +1834,7 @@ export class TimelineUIUtils {
1859
1834
  case recordType.WebSocketSendHandshakeRequest:
1860
1835
  case recordType.WebSocketReceiveHandshakeResponse:
1861
1836
  case recordType.WebSocketDestroy: {
1862
- detailsText = await TimelineUIUtils.buildDetailsTextForTraceEvent(event, target);
1837
+ detailsText = await TimelineUIUtils.buildDetailsTextForTraceEvent(event);
1863
1838
  break;
1864
1839
  }
1865
1840
 
@@ -3110,8 +3085,6 @@ export class TimelineUIUtils {
3110
3085
 
3111
3086
  const duration = TimelineUIUtils.frameDuration(frame);
3112
3087
  contentHelper.appendElementRow(i18nString(UIStrings.duration), duration, frame.hasWarnings());
3113
- const durationInMillis = frame.endTime - frame.startTime;
3114
- contentHelper.appendTextRow(i18nString(UIStrings.fps), Math.floor(1000 / durationInMillis));
3115
3088
  contentHelper.appendTextRow(i18nString(UIStrings.cpuTime), i18n.TimeUtilities.millisToString(frame.cpuTime, true));
3116
3089
  if (filmStripFrame) {
3117
3090
  const filmStripPreview = document.createElement('div');
@@ -74,9 +74,6 @@ Timeline.TimelineEventOverviewResponsiveness = TimelineModule.TimelineEventOverv
74
74
  /** @constructor */
75
75
  Timeline.TimelineFilmStripOverview = TimelineModule.TimelineEventOverview.TimelineFilmStripOverview;
76
76
 
77
- /** @constructor */
78
- Timeline.TimelineEventOverviewFrames = TimelineModule.TimelineEventOverview.TimelineEventOverviewFrames;
79
-
80
77
  /** @constructor */
81
78
  Timeline.TimelineEventOverviewMemory = TimelineModule.TimelineEventOverview.TimelineEventOverviewMemory;
82
79
 
@@ -111,11 +111,6 @@
111
111
  flex-basis: 8px;
112
112
  }
113
113
 
114
- #timeline-overview-framerate {
115
- flex-basis: 16px;
116
- margin-top: 0 !important; /* stylelint-disable-line declaration-no-important */
117
- }
118
-
119
114
  #timeline-overview-filmstrip {
120
115
  flex-basis: 30px;
121
116
  }
@@ -124,7 +119,6 @@
124
119
  flex-basis: 20px;
125
120
  }
126
121
 
127
- #timeline-overview-framerate::before,
128
122
  #timeline-overview-network::before,
129
123
  #timeline-overview-cpu-activity::before {
130
124
  content: "";
@@ -6,7 +6,9 @@ import * as Common from '../../../core/common/common.js';
6
6
  import * as Platform from '../../../core/platform/platform.js';
7
7
 
8
8
  import {EdgeTypes, EdgeView, generateEdgePortIdsByData} from './EdgeView.js';
9
- import type {NodeCreationData, NodeParamConnectionData, NodeParamDisconnectionData, NodesConnectionData, NodesDisconnectionData, NodesDisconnectionDataWithDestination, ParamCreationData} from './GraphStyle.js';
9
+ import type {
10
+ NodeCreationData, NodeParamConnectionData, NodeParamDisconnectionData, NodesConnectionData, NodesDisconnectionData,
11
+ NodesDisconnectionDataWithDestination, ParamCreationData} from './GraphStyle.js';
10
12
  import {NodeLabelGenerator, NodeView} from './NodeView.js';
11
13
 
12
14
  // A class that tracks all the nodes and edges of an audio graph.
@@ -3,7 +3,14 @@
3
3
  // found in the LICENSE file.
4
4
 
5
5
  import type {Point, Size} from './GraphStyle.js';
6
- import {AudioParamRadius, InputPortRadius, LeftSideTopPadding, TotalInputPortHeight, TotalOutputPortHeight, TotalParamPortHeight} from './GraphStyle.js';
6
+ import {
7
+ AudioParamRadius,
8
+ InputPortRadius,
9
+ LeftSideTopPadding,
10
+ TotalInputPortHeight,
11
+ TotalOutputPortHeight,
12
+ TotalParamPortHeight,
13
+ } from './GraphStyle.js';
7
14
 
8
15
  /**
9
16
  * Calculate the x, y value of input port.
@@ -5,7 +5,19 @@
5
5
  import * as UI from '../../../ui/legacy/legacy.js';
6
6
 
7
7
  import type {NodeCreationData, NodeLayout, Port} from './GraphStyle.js';
8
- import {BottomPaddingWithoutParam, BottomPaddingWithParam, LeftMarginOfText, LeftSideTopPadding, NodeLabelFontStyle, ParamLabelFontStyle, PortTypes, RightMarginOfText, TotalInputPortHeight, TotalOutputPortHeight, TotalParamPortHeight} from './GraphStyle.js';
8
+ import {
9
+ BottomPaddingWithoutParam,
10
+ BottomPaddingWithParam,
11
+ LeftMarginOfText,
12
+ LeftSideTopPadding,
13
+ NodeLabelFontStyle,
14
+ ParamLabelFontStyle,
15
+ PortTypes,
16
+ RightMarginOfText,
17
+ TotalInputPortHeight,
18
+ TotalOutputPortHeight,
19
+ TotalParamPortHeight,
20
+ } from './GraphStyle.js';
9
21
  import {calculateInputPortXY, calculateOutputPortXY, calculateParamPortXY} from './NodeRendererUtility.js';
10
22
 
11
23
  // A class that represents a node of a graph, consisting of the information needed to layout the
@@ -7,7 +7,14 @@ import * as AudioContextSelector from './AudioContextSelector.js';
7
7
  import * as WebAudioModel from './WebAudioModel.js';
8
8
  import * as WebAudioView from './WebAudioView.js';
9
9
 
10
- export {EdgeView, GraphManager, GraphStyle, GraphView, NodeRendererUtility, NodeView} from './graph_visualizer/graph_visualizer.js';
10
+ export {
11
+ EdgeView,
12
+ GraphManager,
13
+ GraphStyle,
14
+ GraphView,
15
+ NodeRendererUtility,
16
+ NodeView,
17
+ } from './graph_visualizer/graph_visualizer.js';
11
18
  export {
12
19
  AudioContextContentBuilder,
13
20
  AudioContextSelector,
@@ -27,8 +27,21 @@
27
27
  }
28
28
 
29
29
  button {
30
+ /*
31
+ --override-button-no-right-border-radius decides
32
+ whether button has border radius on the right or not.
33
+
34
+ It works as a boolean variable:
35
+ * If it is 1, `--button-has-right-border-radius` becomes a 0 multiplier
36
+ for the border-radius-top-right and border-radius-bottom-right properties.
37
+ * If it is not set or 0, it becomes a 1 multiplier
38
+ for the same properties which means they'll continue to have the given
39
+ border radius.
40
+ */
41
+ --button-has-right-border-radius: calc(1 - var(--override-button-no-right-border-radius, 0));
42
+
30
43
  align-items: center;
31
- border-radius: 4px;
44
+ border-radius: 4px calc(var(--button-has-right-border-radius) * 4px) calc(var(--button-has-right-border-radius) * 4px) 4px;
32
45
  display: inline-flex;
33
46
  font-family: inherit;
34
47
  font-size: 12px;
@@ -42,7 +55,7 @@ button {
42
55
 
43
56
  button.small {
44
57
  height: 18px;
45
- border-radius: 2px;
58
+ border-radius: 2px calc(var(--button-has-right-border-radius) * 2px) calc(var(--button-has-right-border-radius) * 2px) 2px;
46
59
  }
47
60
 
48
61
  button:focus-visible {
@@ -52,7 +65,7 @@ button:focus-visible {
52
65
  button.toolbar,
53
66
  button.round {
54
67
  background: transparent;
55
- border-radius: 2px;
68
+ border-radius: 2px calc(var(--button-has-right-border-radius) * 2px) calc(var(--button-has-right-border-radius) * 2px) 2px;
56
69
  border: none;
57
70
  height: 24px;
58
71
  width: 24px;
@@ -16,7 +16,15 @@ const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();
16
16
 
17
17
  import {addColumnVisibilityCheckboxes, addSortableColumnItems} from './DataGridContextMenuUtils.js';
18
18
  import type {CellPosition, Column, Row, SortState} from './DataGridUtils.js';
19
- import {calculateColumnWidthPercentageFromWeighting, calculateFirstFocusableCell, getCellTitleFromCellContent, getRowEntryForColumnId, handleArrowKeyNavigation, renderCellValue, SortDirection} from './DataGridUtils.js';
19
+ import {
20
+ calculateColumnWidthPercentageFromWeighting,
21
+ calculateFirstFocusableCell,
22
+ getCellTitleFromCellContent,
23
+ getRowEntryForColumnId,
24
+ handleArrowKeyNavigation,
25
+ renderCellValue,
26
+ SortDirection,
27
+ } from './DataGridUtils.js';
20
28
 
21
29
  import * as i18n from '../../../core/i18n/i18n.js';
22
30
  const UIStrings = {
@@ -33,6 +33,16 @@ primaryButton.title = 'Custom title';
33
33
  primaryButton.onclick = () => alert('clicked');
34
34
  appendButton(primaryButton);
35
35
 
36
+ const primaryButtonWithoutRightBorderRadius = new Buttons.Button.Button();
37
+ primaryButtonWithoutRightBorderRadius.data = {
38
+ variant: Buttons.Button.Variant.PRIMARY,
39
+ };
40
+ primaryButtonWithoutRightBorderRadius.style.setProperty('--override-button-no-right-border-radius', '1');
41
+ primaryButtonWithoutRightBorderRadius.innerText = 'No right border radius';
42
+ primaryButtonWithoutRightBorderRadius.title = 'Custom title';
43
+ primaryButtonWithoutRightBorderRadius.onclick = () => alert('clicked');
44
+ appendButton(primaryButtonWithoutRightBorderRadius);
45
+
36
46
  // Primary (forced active)
37
47
  const forcedActive = new Buttons.Button.Button();
38
48
  forcedActive.data = {
@@ -9,13 +9,21 @@ import linearMemoryInspectorStyles from './linearMemoryInspector.css.js';
9
9
 
10
10
  const {render, html} = LitHtml;
11
11
 
12
- import type {AddressInputChangedEvent, HistoryNavigationEvent, LinearMemoryNavigatorData, PageNavigationEvent} from './LinearMemoryNavigator.js';
12
+ import type {
13
+ AddressInputChangedEvent, HistoryNavigationEvent, LinearMemoryNavigatorData, PageNavigationEvent} from
14
+ './LinearMemoryNavigator.js';
13
15
  import {Mode, Navigation, LinearMemoryNavigator} from './LinearMemoryNavigator.js';
14
- import type {EndiannessChangedEvent, LinearMemoryValueInterpreterData, ValueTypeToggledEvent} from './LinearMemoryValueInterpreter.js';
16
+ import type {
17
+ EndiannessChangedEvent, LinearMemoryValueInterpreterData, ValueTypeToggledEvent} from
18
+ './LinearMemoryValueInterpreter.js';
15
19
  import {LinearMemoryValueInterpreter} from './LinearMemoryValueInterpreter.js';
16
20
  import type {ByteSelectedEvent, LinearMemoryViewerData, ResizeEvent} from './LinearMemoryViewer.js';
17
21
  import type {ValueType, ValueTypeMode} from './ValueInterpreterDisplayUtils.js';
18
- import {VALUE_INTEPRETER_MAX_NUM_BYTES, Endianness, getDefaultValueTypeMapping} from './ValueInterpreterDisplayUtils.js';
22
+ import {
23
+ VALUE_INTEPRETER_MAX_NUM_BYTES,
24
+ Endianness,
25
+ getDefaultValueTypeMapping,
26
+ } from './ValueInterpreterDisplayUtils.js';
19
27
  import {formatAddress, parseAddress} from './LinearMemoryInspectorUtils.js';
20
28
  import type {JumpToPointerAddressEvent, ValueTypeModeChangedEvent} from './ValueInterpreterDisplay.js';
21
29
  import {LinearMemoryViewer} from './LinearMemoryViewer.js';
@@ -9,7 +9,18 @@ import * as ComponentHelpers from '../helpers/helpers.js';
9
9
  import * as IconButton from '../icon_button/icon_button.js';
10
10
 
11
11
  import valueInterpreterDisplayStyles from './valueInterpreterDisplay.css.js';
12
- import {Endianness, format, getDefaultValueTypeMapping, getPointerAddress, isNumber, isPointer, isValidMode, VALUE_TYPE_MODE_LIST, ValueType, ValueTypeMode} from './ValueInterpreterDisplayUtils.js';
12
+ import {
13
+ Endianness,
14
+ format,
15
+ getDefaultValueTypeMapping,
16
+ getPointerAddress,
17
+ isNumber,
18
+ isPointer,
19
+ isValidMode,
20
+ VALUE_TYPE_MODE_LIST,
21
+ ValueType,
22
+ ValueTypeMode,
23
+ } from './ValueInterpreterDisplayUtils.js';
13
24
 
14
25
  const UIStrings = {
15
26
  /**
@@ -11,7 +11,13 @@ import * as Coordinator from '../render_coordinator/render_coordinator.js';
11
11
  import treeOutlineStyles from './treeOutline.css.js';
12
12
 
13
13
  import type {TreeNodeId, TreeNode, TreeNodeWithChildren} from './TreeOutlineUtils.js';
14
- import {findNextNodeForTreeOutlineKeyboardNavigation, getNodeChildren, getPathToTreeNode, isExpandableNode, trackDOMNodeToTreeNode} from './TreeOutlineUtils.js';
14
+ import {
15
+ findNextNodeForTreeOutlineKeyboardNavigation,
16
+ getNodeChildren,
17
+ getPathToTreeNode,
18
+ isExpandableNode,
19
+ trackDOMNodeToTreeNode,
20
+ } from './TreeOutlineUtils.js';
15
21
 
16
22
  const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();
17
23
 
@@ -95,16 +101,15 @@ export class TreeOutline<TreeNodeDataType> extends HTMLElement {
95
101
  */
96
102
  #nodeIdPendingFocus: TreeNodeId|null = null;
97
103
  #selectedTreeNode: TreeNode<TreeNodeDataType>|null = null;
98
- #defaultRenderer =
99
- (node: TreeNode<TreeNodeDataType>, _state: {isExpanded: boolean}): LitHtml.TemplateResult => {
100
- if (typeof node.treeNodeData !== 'string') {
101
- console.warn(`The default TreeOutline renderer simply stringifies its given value. You passed in ${
102
- JSON.stringify(
103
- node.treeNodeData, null,
104
- 2)}. Consider providing a different defaultRenderer that can handle nodes of this type.`);
105
- }
106
- return LitHtml.html`${String(node.treeNodeData)}`;
107
- };
104
+ #defaultRenderer = (node: TreeNode<TreeNodeDataType>, _state: {isExpanded: boolean}): LitHtml.TemplateResult => {
105
+ if (typeof node.treeNodeData !== 'string') {
106
+ console.warn(`The default TreeOutline renderer simply stringifies its given value. You passed in ${
107
+ JSON.stringify(
108
+ node.treeNodeData, null,
109
+ 2)}. Consider providing a different defaultRenderer that can handle nodes of this type.`);
110
+ }
111
+ return LitHtml.html`${String(node.treeNodeData)}`;
112
+ };
108
113
  #nodeFilter?: ((node: TreeNodeDataType) => FilterOption);
109
114
 
110
115
  /**
@@ -212,6 +212,7 @@ export const ActionCategory = {
212
212
  SETTINGS: 'Settings',
213
213
  DEBUGGER: 'Debugger',
214
214
  SOURCES: 'Sources',
215
+ RENDERING: 'Rendering',
215
216
  };
216
217
 
217
218
  type ActionCategory = typeof ActionCategory[keyof typeof ActionCategory];
@@ -66,8 +66,8 @@ export class Fragment {
66
66
 
67
67
  const template = document.createElement('template');
68
68
  template.innerHTML = html;
69
- const walker = template.ownerDocument.createTreeWalker(
70
- template.content, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_TEXT, null);
69
+ const walker =
70
+ template.ownerDocument.createTreeWalker(template.content, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_TEXT, null);
71
71
  let valueIndex = 0;
72
72
  const emptyTextNodes = [];
73
73
  const binds: Bind[] = [];
@@ -1084,6 +1084,10 @@ export class ToolbarCheckbox extends ToolbarItem<void> {
1084
1084
  super.applyEnabledState(enabled);
1085
1085
  this.inputElement.disabled = !enabled;
1086
1086
  }
1087
+
1088
+ setIndeterminate(indeterminate: boolean): void {
1089
+ this.inputElement.indeterminate = indeterminate;
1090
+ }
1087
1091
  }
1088
1092
 
1089
1093
  export class ToolbarSettingCheckbox extends ToolbarCheckbox {
@@ -15,7 +15,18 @@ import type {ToolbarItem} from './Toolbar.js';
15
15
  import {Toolbar, ToolbarMenuButton} from './Toolbar.js';
16
16
  import {createTextChild} from './UIUtils.js';
17
17
  import type {TabbedViewLocation, View, ViewLocation, ViewLocationResolver} from './View.js';
18
- import {getRegisteredLocationResolvers, getRegisteredViewExtensions, maybeRemoveViewExtension, registerLocationResolver, registerViewExtension, ViewLocationCategoryValues, ViewLocationValues, ViewPersistence, type ViewRegistration, resetViewRegistration} from './ViewRegistration.js';
18
+ import {
19
+ getRegisteredLocationResolvers,
20
+ getRegisteredViewExtensions,
21
+ maybeRemoveViewExtension,
22
+ registerLocationResolver,
23
+ registerViewExtension,
24
+ ViewLocationCategoryValues,
25
+ ViewLocationValues,
26
+ ViewPersistence,
27
+ type ViewRegistration,
28
+ resetViewRegistration,
29
+ } from './ViewRegistration.js';
19
30
  import type {Widget, WidgetElement} from './Widget.js';
20
31
  import {VBox} from './Widget.js';
21
32
  import viewContainersStyles from './viewContainers.css.legacy.js';
@@ -13,7 +13,12 @@ import * as ARIAUtils from './ARIAUtils.js';
13
13
  import type {ContextMenu, Provider} from './ContextMenu.js';
14
14
  import {html} from './Fragment.js';
15
15
  import {Tooltip} from './Tooltip.js';
16
- import {addReferrerToURLIfNecessary, copyLinkAddressLabel, MaxLengthForDisplayedURLs, openLinkExternallyLabel} from './UIUtils.js';
16
+ import {
17
+ addReferrerToURLIfNecessary,
18
+ copyLinkAddressLabel,
19
+ MaxLengthForDisplayedURLs,
20
+ openLinkExternallyLabel,
21
+ } from './UIUtils.js';
17
22
  import {XElement} from './XElement.js';
18
23
 
19
24
  export class XLink extends XElement {
@@ -7,7 +7,14 @@ import * as LitHtml from '../../../lit-html/lit-html.js';
7
7
  import cssAngleStyles from './cssAngle.css.js';
8
8
 
9
9
  import type {Angle} from './CSSAngleUtils.js';
10
- import {AngleUnit, convertAngleUnit, getNewAngleFromEvent, getNextUnit, parseText, roundAngleByUnit} from './CSSAngleUtils.js';
10
+ import {
11
+ AngleUnit,
12
+ convertAngleUnit,
13
+ getNewAngleFromEvent,
14
+ getNextUnit,
15
+ parseText,
16
+ roundAngleByUnit,
17
+ } from './CSSAngleUtils.js';
11
18
  import {ValueChangedEvent} from './InlineEditorUtils.js';
12
19
 
13
20
  import type {CSSAngleEditorData} from './CSSAngleEditor.js';
@@ -8,7 +8,13 @@ import * as LitHtml from '../../../lit-html/lit-html.js';
8
8
  import cssAngleEditorStyles from './cssAngleEditor.css.js';
9
9
 
10
10
  import type {Angle} from './CSSAngleUtils.js';
11
- import {AngleUnit, get2DTranslationsForAngle, getAngleFromRadians, getNewAngleFromEvent, getRadiansFromAngle} from './CSSAngleUtils.js';
11
+ import {
12
+ AngleUnit,
13
+ get2DTranslationsForAngle,
14
+ getAngleFromRadians,
15
+ getNewAngleFromEvent,
16
+ getRadiansFromAngle,
17
+ } from './CSSAngleUtils.js';
12
18
 
13
19
  const {render, html} = LitHtml;
14
20
  const styleMap = LitHtml.Directives.styleMap;
package/package.json CHANGED
@@ -55,5 +55,5 @@
55
55
  "unittest": "scripts/test/run_unittests.py --no-text-coverage",
56
56
  "watch": "vpython third_party/node/node.py --output scripts/watch_build.js"
57
57
  },
58
- "version": "1.0.998281"
58
+ "version": "1.0.999791"
59
59
  }
@@ -0,0 +1,60 @@
1
+ // Copyright 2022 The Chromium Authors. All rights reserved.
2
+ // Use of this source code is governed by a BSD-style license that can be
3
+ // found in the LICENSE file.
4
+
5
+ /**
6
+ * Run this script to re-format all .js and .ts files found
7
+ * node scripts/reformat-clang-js-ts.js --directory=front_end
8
+ * The script starts in the given directory and recursively finds all `.js` and `.ts` files to reformat.
9
+ * Any `.clang-format` with `DisableFormat: true` is respected; those
10
+ * directories will not be used.
11
+ **/
12
+
13
+ const fs = require('fs');
14
+ const path = require('path');
15
+ const childProcess = require('child_process');
16
+
17
+ const yargs = require('yargs')
18
+ .option('dry-run', {
19
+ type: 'boolean',
20
+ default: false,
21
+ desc: 'Logs which files will be formatted, but doesn\'t write to disk',
22
+ })
23
+ .option('directory', {type: 'string', demandOption: true, desc: 'The starting directory to run in.'})
24
+ .strict()
25
+ .argv;
26
+
27
+ const startingDirectory = path.join(process.cwd(), yargs.directory);
28
+
29
+ const filesToFormat = [];
30
+ function processDirectory(dir) {
31
+ const contents = fs.readdirSync(dir);
32
+
33
+ if (contents.includes('.clang-format')) {
34
+ const clangFormatConfig = fs.readFileSync(path.join(dir, '.clang-format'), 'utf8');
35
+ if (clangFormatConfig.includes('DisableFormat: true')) {
36
+ return;
37
+ }
38
+ }
39
+ for (const item of contents) {
40
+ const fullPath = path.join(dir, item);
41
+ if (fs.lstatSync(fullPath).isDirectory()) {
42
+ processDirectory(fullPath);
43
+ } else if (['.ts', '.js'].includes(path.extname(fullPath))) {
44
+ filesToFormat.push(fullPath);
45
+ }
46
+ }
47
+ }
48
+
49
+ processDirectory(startingDirectory);
50
+ filesToFormat.forEach((file, index) => {
51
+ console.log(`Formatting ${index + 1}/${filesToFormat.length}`, path.relative(process.cwd(), file));
52
+
53
+ if (yargs.dryRun) {
54
+ return;
55
+ }
56
+ const out = String(childProcess.execSync(`clang-format -i ${file}`));
57
+ if (out.trim() !== '') {
58
+ console.log(out);
59
+ }
60
+ });