chrome-devtools-frontend 1.0.939144 → 1.0.940714

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 (53) hide show
  1. package/.stylelintrc.json +1 -7
  2. package/config/gni/all_devtools_files.gni +0 -1
  3. package/config/gni/devtools_grd_files.gni +2 -0
  4. package/docs/triage_guidelines.md +13 -11
  5. package/front_end/Tests.js +33 -0
  6. package/front_end/core/host/InspectorFrontendHostAPI.ts +5 -0
  7. package/front_end/core/host/UserMetrics.ts +72 -0
  8. package/front_end/core/i18n/locales/en-US.json +30 -9
  9. package/front_end/core/i18n/locales/en-XL.json +30 -9
  10. package/front_end/core/protocol_client/InspectorBackend.ts +4 -0
  11. package/front_end/core/root/Runtime.ts +4 -0
  12. package/front_end/core/sdk/CSSModel.ts +64 -50
  13. package/front_end/core/sdk/CategorizedBreakpoint.ts +35 -0
  14. package/front_end/core/sdk/DOMDebuggerModel.ts +28 -42
  15. package/front_end/core/sdk/EventBreakpointsModel.ts +178 -0
  16. package/front_end/core/sdk/Target.ts +2 -1
  17. package/front_end/core/sdk/sdk.ts +4 -0
  18. package/front_end/devtools_compatibility.js +5 -0
  19. package/front_end/entrypoints/main/MainImpl.ts +6 -3
  20. package/front_end/entrypoints/main/main-meta.ts +1 -2
  21. package/front_end/entrypoints/shell/shell.js +1 -0
  22. package/front_end/entrypoints/shell/shell.json +0 -1
  23. package/front_end/models/logs/LogManager.ts +1 -0
  24. package/front_end/panels/accessibility/AXBreadcrumbsPane.ts +1 -1
  25. package/front_end/panels/accessibility/AccessibilityNodeView.ts +1 -1
  26. package/front_end/panels/application/ApplicationPanelCacheSection.ts +1 -1
  27. package/front_end/panels/application/BackForwardCacheView.ts +24 -24
  28. package/front_end/panels/browser_debugger/CSPViolationBreakpointsSidebarPane.ts +2 -2
  29. package/front_end/panels/browser_debugger/CategorizedBreakpointsSidebarPane.ts +7 -7
  30. package/front_end/panels/browser_debugger/EventListenerBreakpointsSidebarPane.ts +14 -6
  31. package/front_end/panels/css_overview/components/CSSOverviewStartView.ts +6 -8
  32. package/front_end/panels/css_overview/components/cssOverviewStartView.css +7 -1
  33. package/front_end/panels/elements/StylesSidebarPane.ts +2 -1
  34. package/front_end/panels/issues/IssueKindView.ts +22 -4
  35. package/front_end/panels/lighthouse/LighthouseController.ts +10 -33
  36. package/front_end/panels/lighthouse/LighthousePanel.ts +2 -1
  37. package/front_end/panels/lighthouse/LighthouseReportRenderer.ts +2 -1
  38. package/front_end/panels/network/NetworkLogView.ts +16 -0
  39. package/front_end/panels/network/RequestPayloadView.ts +2 -0
  40. package/front_end/panels/network/requestPayloadTree.css +5 -0
  41. package/front_end/panels/protocol_monitor/ProtocolMonitor.ts +1 -0
  42. package/front_end/panels/settings/components/SyncSection.ts +25 -4
  43. package/front_end/panels/sources/DebuggerPausedMessage.ts +14 -7
  44. package/front_end/third_party/codemirror.next/bundle-tsconfig.json +1 -1
  45. package/front_end/ui/components/buttons/Button.ts +11 -0
  46. package/front_end/ui/components/buttons/button.css +4 -0
  47. package/front_end/ui/components/docs/button/basic.ts +10 -0
  48. package/package.json +2 -2
  49. package/scripts/eslint_rules/lib/check_component_naming.js +1 -1
  50. package/scripts/eslint_rules/lib/enforce_custom_event_names.js +1 -1
  51. package/scripts/eslint_rules/lib/l10n_no_i18nString_calls_module_instantiation.js +1 -1
  52. package/scripts/eslint_rules/lib/no_underscored_properties.js +1 -1
  53. package/front_end/entrypoints/main/module.json +0 -5
@@ -8,6 +8,7 @@ import type * as Host from '../../../core/host/host.js';
8
8
  import * as i18n from '../../../core/i18n/i18n.js';
9
9
  import * as LitHtml from '../../../ui/lit-html/lit-html.js';
10
10
  import * as Settings from '../../../ui/components/settings/settings.js';
11
+ import * as SDK from '../../../core/sdk/sdk.js';
11
12
 
12
13
  import syncSectionStyles from './syncSection.css.js';
13
14
 
@@ -81,21 +82,31 @@ export class SyncSection extends HTMLElement {
81
82
  }
82
83
  }
83
84
 
85
+ /* x-link doesn't work with custom click/keydown handlers */
86
+ /* eslint-disable rulesdir/ban_a_tags_in_lit_html */
87
+
84
88
  function renderAccountInfoOrWarning(syncInfo: Host.InspectorFrontendHostAPI.SyncInformation): LitHtml.TemplateResult {
85
89
  if (!syncInfo.isSyncActive) {
90
+ const link = 'chrome://settings/syncSetup';
91
+ // Disabled until https://crbug.com/1079231 is fixed.
92
+ // clang-format off
86
93
  return LitHtml.html`
87
94
  <span class="warning">
88
- ${i18nString(UIStrings.syncDisabled)} <x-link href="chrome://settings/syncSetup" class="link">${
89
- i18nString(UIStrings.settings)}</x-link>
95
+ ${i18nString(UIStrings.syncDisabled)} <a href="${link}" class="link" target="_blank"
96
+ @click=${(e: Event): void => openSettingsTab(link, e)}
97
+ @keydown=${(e: Event): void => openSettingsTab(link, e)}>${i18nString(UIStrings.settings)}</x-link>
90
98
  </span>`;
99
+ // clang-format on
91
100
  }
92
101
  if (!syncInfo.arePreferencesSynced) {
102
+ const link = 'chrome://settings/syncSetup/advanced';
93
103
  // Disabled until https://crbug.com/1079231 is fixed.
94
104
  // clang-format off
95
105
  return LitHtml.html`
96
106
  <span class="warning">
97
- ${i18nString(UIStrings.preferencesSyncDisabled)} <x-link href="chrome://settings/syncSetup/advanced" class="link">${
98
- i18nString(UIStrings.settings)}</x-link>
107
+ ${i18nString(UIStrings.preferencesSyncDisabled)} <a href="${link}" class="link" target="_blank"
108
+ @click=${(e: Event): void => openSettingsTab(link, e)}
109
+ @keydown=${(e: Event): void => openSettingsTab(link, e)}>${i18nString(UIStrings.settings)}</x-link>
99
110
  </span>`;
100
111
  // clang-format on
101
112
  }
@@ -109,6 +120,16 @@ function renderAccountInfoOrWarning(syncInfo: Host.InspectorFrontendHostAPI.Sync
109
120
  </div>`;
110
121
  }
111
122
 
123
+ // Navigating to a chrome:// link via a normal anchor doesn't work, so we "navigate"
124
+ // there using CDP.
125
+ function openSettingsTab(url: string, event: Event): void {
126
+ if (event.type === 'click' || (event.type === 'keydown' && self.isEnterOrSpaceKey(event))) {
127
+ const mainTarget = SDK.TargetManager.TargetManager.instance().mainTarget();
128
+ mainTarget && mainTarget.targetAgent().invoke_createTarget({url});
129
+ event.consume(true);
130
+ }
131
+ }
132
+
112
133
  ComponentHelpers.CustomElements.defineComponent('devtools-sync-section', SyncSection);
113
134
 
114
135
  declare global {
@@ -191,13 +191,20 @@ export class DebuggerPausedMessage {
191
191
  } else if (details.reason === Protocol.Debugger.PausedEventReason.EventListener) {
192
192
  let eventNameForUI = '';
193
193
  if (details.auxData) {
194
- eventNameForUI =
195
- SDK.DOMDebuggerModel.DOMDebuggerManager.instance().resolveEventListenerBreakpointTitle((details.auxData as {
196
- directiveText: string,
197
- eventName: string,
198
- targetName: string,
199
- webglErrorName: string,
200
- }));
194
+ const maybeNonDomEventNameForUI =
195
+ SDK.EventBreakpointsModel.EventBreakpointsManager.instance().resolveEventListenerBreakpointTitle(
196
+ (details.auxData as {eventName: string}));
197
+ if (maybeNonDomEventNameForUI) {
198
+ eventNameForUI = maybeNonDomEventNameForUI;
199
+ } else {
200
+ eventNameForUI = SDK.DOMDebuggerModel.DOMDebuggerManager.instance().resolveEventListenerBreakpointTitle(
201
+ (details.auxData as {
202
+ directiveText: string,
203
+ eventName: string,
204
+ targetName: string,
205
+ webglErrorName: string,
206
+ }));
207
+ }
201
208
  }
202
209
  messageWrapper = buildWrapper(i18nString(UIStrings.pausedOnEventListener), eventNameForUI);
203
210
  } else if (details.reason === Protocol.Debugger.PausedEventReason.XHR) {
@@ -16,6 +16,6 @@
16
16
  "chunk/php.js",
17
17
  "chunk/python.js",
18
18
  "chunk/wast.js",
19
- "chunk/xml.js",
19
+ "chunk/xml.js"
20
20
  ]
21
21
  }
@@ -30,6 +30,7 @@ interface ButtonState {
30
30
  variant?: Variant;
31
31
  size?: Size;
32
32
  disabled: boolean;
33
+ active: boolean;
33
34
  }
34
35
 
35
36
  export type ButtonData = {
@@ -37,11 +38,13 @@ export type ButtonData = {
37
38
  iconUrl: string,
38
39
  size?: Size,
39
40
  disabled?: boolean,
41
+ active?: boolean,
40
42
  }|{
41
43
  variant: Variant.PRIMARY | Variant.SECONDARY,
42
44
  iconUrl?: string,
43
45
  size?: Size,
44
46
  disabled?: boolean,
47
+ active?: boolean,
45
48
  };
46
49
 
47
50
  export class Button extends HTMLElement {
@@ -52,6 +55,7 @@ export class Button extends HTMLElement {
52
55
  private readonly props: ButtonState = {
53
56
  size: Size.MEDIUM,
54
57
  disabled: false,
58
+ active: false,
55
59
  };
56
60
  private isEmpty = true;
57
61
 
@@ -69,6 +73,7 @@ export class Button extends HTMLElement {
69
73
  this.props.variant = data.variant;
70
74
  this.props.iconUrl = data.iconUrl;
71
75
  this.props.size = data.size || Size.MEDIUM;
76
+ this.props.active = Boolean(data.active);
72
77
  this.setDisabledProperty(data.disabled || false);
73
78
  ComponentHelpers.ScheduledRender.scheduleRender(this, this.boundRender);
74
79
  }
@@ -93,6 +98,11 @@ export class Button extends HTMLElement {
93
98
  ComponentHelpers.ScheduledRender.scheduleRender(this, this.boundRender);
94
99
  }
95
100
 
101
+ set active(active: boolean) {
102
+ this.props.active = active;
103
+ ComponentHelpers.ScheduledRender.scheduleRender(this, this.boundRender);
104
+ }
105
+
96
106
  private setDisabledProperty(disabled: boolean): void {
97
107
  this.props.disabled = disabled;
98
108
  this.toggleAttribute('disabled', disabled);
@@ -140,6 +150,7 @@ export class Button extends HTMLElement {
140
150
  'text-with-icon': Boolean(this.props.iconUrl) && !this.isEmpty,
141
151
  'only-icon': Boolean(this.props.iconUrl) && this.isEmpty,
142
152
  small: Boolean(this.props.size === Size.SMALL),
153
+ active: this.props.active,
143
154
  };
144
155
  // clang-format off
145
156
  LitHtml.render(
@@ -80,6 +80,7 @@ button.primary:hover {
80
80
  border: 1px solid var(--color-button-primary-background-hovering);
81
81
  }
82
82
 
83
+ button.primary.active,
83
84
  button.primary:active {
84
85
  background: var(--color-button-primary-background-pressed);
85
86
  border: 1px solid var(--color-button-primary-background-pressed);
@@ -103,6 +104,7 @@ button.secondary:hover {
103
104
  background: var(--color-button-secondary-background-hovering);
104
105
  }
105
106
 
107
+ button.secondary.active,
106
108
  button.secondary:active {
107
109
  background: var(--color-button-secondary-background-pressed);
108
110
  border: 1px solid var(--color-button-secondary-background-pressed);
@@ -120,6 +122,7 @@ button.secondary:disabled:hover {
120
122
  cursor: not-allowed;
121
123
  }
122
124
 
125
+ button.secondary.active:focus-visible,
123
126
  button.secondary:active:focus-visible {
124
127
  border: 1px solid var(--color-button-secondary-background-pressed);
125
128
  }
@@ -128,6 +131,7 @@ button.toolbar:hover {
128
131
  background-color: var(--color-button-secondary-background-hovering);
129
132
  }
130
133
 
134
+ button.toolbar.active,
131
135
  button.toolbar:active {
132
136
  background-color: var(--color-button-secondary-background-pressed);
133
137
  }
@@ -32,6 +32,16 @@ primaryButton.innerText = 'Click me';
32
32
  primaryButton.onclick = () => alert('clicked');
33
33
  appendButton(primaryButton);
34
34
 
35
+ // Primary (forced active)
36
+ const forcedActive = new Buttons.Button.Button();
37
+ forcedActive.data = {
38
+ variant: Buttons.Button.Variant.PRIMARY,
39
+ active: true,
40
+ };
41
+ forcedActive.innerText = 'Forced active';
42
+ forcedActive.onclick = () => alert('clicked');
43
+ appendButton(forcedActive);
44
+
35
45
  // Secondary
36
46
  const secondaryButton = new Buttons.Button.Button();
37
47
  secondaryButton.innerText = 'Click me';
package/package.json CHANGED
@@ -31,7 +31,7 @@
31
31
  "check-external-links": "third_party/node/node.py --output scripts/check_external_links.js",
32
32
  "check-gn": "third_party/node/node.py --output scripts/check_gn.js",
33
33
  "check-json": "third_party/node/node.py --output scripts/json_validator/validate_module_json.js",
34
- "check-lint": "third_party/node/node.py --output scripts/test/run_lint_check_js.js && third_party/node/node.py --output scripts/test/run_lint_check_css.js",
34
+ "check-lint": "third_party/node/node.py --output scripts/test/run_lint_check_js.mjs && third_party/node/node.py --output scripts/test/run_lint_check_css.js",
35
35
  "check-lint-css": "third_party/node/node.py --output scripts/test/run_lint_check_css.js",
36
36
  "collect-strings": "third_party/node/node.py --output third_party/i18n/collect-strings.js front_end",
37
37
  "components-server": "third_party/node/node.py --output scripts/component_server/server.js",
@@ -55,5 +55,5 @@
55
55
  "unittest": "scripts/test/run_unittests.py --no-text-coverage",
56
56
  "watch": "third_party/node/node.py --output scripts/watch_build.js"
57
57
  },
58
- "version": "1.0.939144"
58
+ "version": "1.0.940714"
59
59
  }
@@ -44,7 +44,7 @@ module.exports = {
44
44
 
45
45
  function findComponentTagNameFromStaticProperty(classBodyNode) {
46
46
  return classBodyNode.body.find(node => {
47
- return node.type === 'ClassProperty' && node.key.name === 'litTagName';
47
+ return node.type === 'PropertyDefinition' && node.key.name === 'litTagName';
48
48
  });
49
49
  }
50
50
 
@@ -73,7 +73,7 @@ module.exports = {
73
73
 
74
74
  // If the reference is right, let's find the value of the static eventName property and make sure it is valid.
75
75
  const eventNameProperty = node.body.body.find(classBodyPart => {
76
- return classBodyPart.type === 'ClassProperty' && classBodyPart.key.name === 'eventName';
76
+ return classBodyPart.type === 'PropertyDefinition' && classBodyPart.key.name === 'eventName';
77
77
  });
78
78
 
79
79
  // This should always exist because we checked for its existence
@@ -7,7 +7,7 @@
7
7
  // One of these AST nodes must be an ancestor of an i18nString call.
8
8
  const REQUIRED_ANCESTOR = new Set([
9
9
  'ArrowFunctionExpression',
10
- 'ClassProperty',
10
+ 'PropertyDefinition',
11
11
  'FunctionDeclaration',
12
12
  'FunctionExpression',
13
13
  'MethodDefinition',
@@ -49,7 +49,7 @@ module.exports = {
49
49
  },
50
50
  create: function(context) {
51
51
  return {
52
- ClassProperty(node) {
52
+ PropertyDefinition(node) {
53
53
  checkNodeForUnderscoredProperties(context, node, 'property');
54
54
  },
55
55
  MethodDefinition(node) {
@@ -1,5 +0,0 @@
1
- {
2
- "dependencies": [
3
- "ui/legacy"
4
- ]
5
- }