chrome-devtools-frontend 1.0.953165 → 1.0.954163

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 (64) hide show
  1. package/config/gni/devtools_grd_files.gni +4 -0
  2. package/config/gni/devtools_image_files.gni +1 -0
  3. package/front_end/Images/src/info-icon.svg +1 -0
  4. package/front_end/core/common/ParsedURL.ts +31 -0
  5. package/front_end/core/i18n/i18nImpl.ts +8 -30
  6. package/front_end/core/i18n/locales/en-US.json +48 -0
  7. package/front_end/core/i18n/locales/en-XL.json +48 -0
  8. package/front_end/core/platform/number-utilities.ts +5 -7
  9. package/front_end/core/platform/string-utilities.ts +45 -25
  10. package/front_end/core/sdk/PageResourceLoader.ts +1 -2
  11. package/front_end/core/sdk/ResourceTreeModel.ts +12 -2
  12. package/front_end/generated/InspectorBackendCommands.js +3 -1
  13. package/front_end/generated/protocol.d.ts +19 -0
  14. package/front_end/models/extensions/ExtensionServer.ts +2 -3
  15. package/front_end/panels/application/components/BackForwardCacheStrings.ts +93 -15
  16. package/front_end/panels/application/components/EndpointsGrid.ts +1 -1
  17. package/front_end/panels/application/storageView.css +1 -1
  18. package/front_end/panels/elements/components/AdornerSettingsPane.ts +2 -1
  19. package/front_end/panels/elements/components/LayoutPane.ts +2 -0
  20. package/front_end/panels/elements/components/elementsBreadcrumbs.css +2 -0
  21. package/front_end/panels/elements/elementStatePaneWidget.css +1 -1
  22. package/front_end/panels/elements/layoutPane.css +0 -4
  23. package/front_end/panels/emulation/components/DeviceSizeInputElement.ts +2 -0
  24. package/front_end/panels/network/NetworkDataGridNode.ts +0 -2
  25. package/front_end/panels/network/components/WebBundleInfoView.ts +1 -1
  26. package/front_end/panels/settings/emulation/components/UserAgentClientHintsForm.ts +2 -1
  27. package/front_end/panels/web_audio/webAudio.css +1 -1
  28. package/front_end/third_party/puppeteer/package/README.md +11 -11
  29. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/AriaQueryHandler.js +2 -2
  30. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/AriaQueryHandler.js.map +1 -1
  31. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/DOMWorld.d.ts +2 -0
  32. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/DOMWorld.d.ts.map +1 -1
  33. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/DOMWorld.js +20 -11
  34. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/DOMWorld.js.map +1 -1
  35. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/JSHandle.d.ts.map +1 -1
  36. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/JSHandle.js +13 -3
  37. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/JSHandle.js.map +1 -1
  38. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/AriaQueryHandler.js +2 -2
  39. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/AriaQueryHandler.js.map +1 -1
  40. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/DOMWorld.d.ts +2 -0
  41. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/DOMWorld.d.ts.map +1 -1
  42. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/DOMWorld.js +20 -11
  43. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/DOMWorld.js.map +1 -1
  44. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/JSHandle.d.ts.map +1 -1
  45. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/JSHandle.js +13 -3
  46. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/JSHandle.js.map +1 -1
  47. package/front_end/third_party/puppeteer/package/lib/types.d.ts +2 -0
  48. package/front_end/third_party/puppeteer/package/package.json +1 -1
  49. package/front_end/ui/components/input/checkbox.css +11 -0
  50. package/front_end/ui/components/input/input.ts +3 -3
  51. package/front_end/ui/components/linear_memory_inspector/ValueInterpreterSettings.ts +2 -1
  52. package/front_end/ui/components/markdown_view/MarkdownView.ts +1 -1
  53. package/front_end/ui/components/panel_feedback/PreviewToggle.ts +2 -1
  54. package/front_end/ui/components/settings/SettingCheckbox.ts +2 -1
  55. package/front_end/ui/components/settings/settingCheckbox.css +0 -5
  56. package/front_end/ui/legacy/RemoteDebuggingTerminatedScreen.ts +10 -3
  57. package/front_end/ui/legacy/UIUtils.ts +0 -12
  58. package/front_end/ui/legacy/themeColors.css +3 -2
  59. package/front_end/ui/legacy/treeoutline.css +1 -1
  60. package/inspector_overlay/main.ts +2 -16
  61. package/package.json +1 -1
  62. package/scripts/eslint_rules/lib/lit_html_host_this.js +1 -10
  63. package/scripts/eslint_rules/lib/utils.js +20 -1
  64. package/scripts/eslint_rules/tests/utils_test.js +30 -0
@@ -8,6 +8,7 @@ import * as LitHtml from '../../../ui/lit-html/lit-html.js';
8
8
  import * as ComponentHelpers from '../helpers/helpers.js';
9
9
  import * as IconButton from '../icon_button/icon_button.js';
10
10
 
11
+ import * as Input from '../input/input.js';
11
12
  import previewToggleStyles from './previewToggle.css.js';
12
13
 
13
14
  const {render, html, nothing} = LitHtml;
@@ -41,7 +42,7 @@ export class PreviewToggle extends HTMLElement {
41
42
  #onChangeCallback?: (checked: boolean) => void;
42
43
 
43
44
  connectedCallback(): void {
44
- this.#shadow.adoptedStyleSheets = [previewToggleStyles];
45
+ this.#shadow.adoptedStyleSheets = [Input.checkboxStyles, previewToggleStyles];
45
46
  }
46
47
 
47
48
  set data(data: PreviewToggleData) {
@@ -6,6 +6,7 @@ import type * as Common from '../../../core/common/common.js';
6
6
  import * as ComponentHelpers from '../../components/helpers/helpers.js';
7
7
  import * as LitHtml from '../../lit-html/lit-html.js';
8
8
 
9
+ import * as Input from '../input/input.js';
9
10
  import settingCheckboxStyles from './settingCheckbox.css.js';
10
11
 
11
12
  export interface SettingCheckboxData {
@@ -29,7 +30,7 @@ export class SettingCheckbox extends HTMLElement {
29
30
  #changeListenerDescriptor?: Common.EventTarget.EventDescriptor;
30
31
 
31
32
  connectedCallback(): void {
32
- this.#shadow.adoptedStyleSheets = [settingCheckboxStyles];
33
+ this.#shadow.adoptedStyleSheets = [Input.checkboxStyles, settingCheckboxStyles];
33
34
  }
34
35
 
35
36
  set data(data: SettingCheckboxData) {
@@ -24,8 +24,3 @@ label {
24
24
  p {
25
25
  margin: 12px 0;
26
26
  }
27
-
28
- /* Preserve look of legacy checkboxes in dark mode */
29
- :host-context(.-theme-with-dark-background) input[type="checkbox"]:not(.-theme-preserve) {
30
- accent-color: var(--color-checkbox-accent-color);
31
- }
@@ -7,10 +7,16 @@ import * as i18n from '../../core/i18n/i18n.js';
7
7
  import {Dialog} from './Dialog.js';
8
8
  import {SizeBehavior} from './GlassPane.js';
9
9
  import remoteDebuggingTerminatedScreenStyles from './remoteDebuggingTerminatedScreen.css.legacy.js';
10
- import {createTextButton, formatLocalized} from './UIUtils.js';
10
+ import {createTextButton} from './UIUtils.js';
11
11
  import {VBox} from './Widget.js';
12
12
 
13
13
  const UIStrings = {
14
+ /**
15
+ * @description Text in a dialog box in DevTools stating why remote debugging has been terminated.
16
+ * "Remote debugging" here means that DevTools on a PC is inspecting a website running on an actual mobile device
17
+ * (see https://developer.chrome.com/docs/devtools/remote-debugging/).
18
+ */
19
+ debuggingConnectionWasClosed: 'Debugging connection was closed. Reason: ',
14
20
  /**
15
21
  * @description Text in a dialog box showing how to reconnect to DevTools when remote debugging has been terminated.
16
22
  * "Remote debugging" here means that DevTools on a PC is inspecting a website running on an actual mobile device
@@ -33,9 +39,10 @@ export class RemoteDebuggingTerminatedScreen extends VBox {
33
39
  super(true);
34
40
  this.registerRequiredCSS(remoteDebuggingTerminatedScreenStyles);
35
41
  const message = this.contentElement.createChild('div', 'message');
36
- const reasonElement = message.createChild('span', 'reason');
42
+ const span = message.createChild('span');
43
+ span.append(i18nString(UIStrings.debuggingConnectionWasClosed));
44
+ const reasonElement = span.createChild('span', 'reason');
37
45
  reasonElement.textContent = reason;
38
- message.appendChild(formatLocalized('Debugging connection was closed. Reason: %s', [reasonElement]));
39
46
  this.contentElement.createChild('div', 'message').textContent = i18nString(UIStrings.reconnectWhenReadyByReopening);
40
47
  const button = createTextButton(i18nString(UIStrings.reconnectDevtools), () => window.location.reload());
41
48
  this.contentElement.createChild('div', 'button').appendChild(button);
@@ -583,18 +583,6 @@ export function handleElementValueModifications(
583
583
  return false;
584
584
  }
585
585
 
586
- export function formatLocalized<U>(format: string, substitutions: ArrayLike<U>|null): Element {
587
- const formatters = {
588
- s: (substitution: unknown): unknown => substitution,
589
- };
590
- function append(a: Element, b: string|Element): Element {
591
- a.appendChild(typeof b === 'string' ? document.createTextNode(b) : b as Element);
592
- return a;
593
- }
594
- return Platform.StringUtilities.format(format, substitutions, formatters, document.createElement('span'), append)
595
- .formattedResult;
596
- }
597
-
598
586
  export function openLinkExternallyLabel(): string {
599
587
  return i18nString(UIStrings.openInNewTab);
600
588
  }
@@ -25,7 +25,7 @@
25
25
  --color-background-elevation-2: rgb(222 225 230);
26
26
  /** Used when the elevation is visible only on dark theme */
27
27
  --color-background-elevation-dark-only: var(--color-background);
28
- --color-background-highlight: rgb(202 205 209);
28
+ --color-background-highlight: rgb(218 220 224);
29
29
  /** To draw grid lines behind elements */
30
30
  --divider-line: rgb(0 0 0 / 10%);
31
31
  /**
@@ -108,6 +108,7 @@
108
108
  --color-error-text: #f00;
109
109
  --color-error-border: hsl(0deg 100% 92%);
110
110
  --color-error-background: hsl(0deg 100% 97%);
111
+ --color-checkbox-accent-color: var(--color-primary);
111
112
  --color-image-preview-background: rgb(255 255 255);
112
113
 
113
114
  /* Colors for styling inputs */
@@ -202,7 +203,7 @@
202
203
  --color-background-elevation-1: rgb(41 42 45);
203
204
  --color-background-elevation-2: rgb(53 54 58);
204
205
  --color-background-elevation-dark-only: var(--color-background-elevation-1);
205
- --color-background-highlight: rgb(75 76 79);
206
+ --color-background-highlight: rgb(69 69 69);
206
207
  --divider-line: rgb(255 255 255 / 10%);
207
208
  --color-background-hover-overlay: rgb(56 121 217 / 10%);
208
209
  --color-selection-highlight: rgb(251 202 70 / 20%);
@@ -56,7 +56,7 @@
56
56
  }
57
57
 
58
58
  .tree-outline:not(.hide-selection-when-blurred) li.in-clipboard .highlight {
59
- outline: 1px dotted var(--color-background-highlight);
59
+ outline: 1px dotted var(--color-details-hairline);
60
60
  }
61
61
 
62
62
  ol.tree-outline:not(.hide-selection-when-blurred) li.selected:focus .selection {
@@ -80,17 +80,10 @@ type MessageLookup = {
80
80
  drawingFinished: '',
81
81
  };
82
82
 
83
- let queue: unknown[][] = [];
84
- let prevQueue: string = '';
85
-
86
83
  const dispatch = <K extends keyof MessageLookup>(message: [a: K, b: MessageLookup[K]]) => {
87
84
  const functionName = message[0];
88
85
  if (functionName === 'setOverlay') {
89
86
  const overlayName = message[1] as keyof Overlays;
90
- // No need to swap overlays if it's the same overlay.
91
- if (overlays[overlayName] === currentOverlay) {
92
- return;
93
- }
94
87
  if (currentOverlay) {
95
88
  currentOverlay.uninstall();
96
89
  }
@@ -104,16 +97,9 @@ const dispatch = <K extends keyof MessageLookup>(message: [a: K, b: MessageLooku
104
97
  } else if (functionName === 'setPlatform') {
105
98
  platformName = message[1];
106
99
  } else if (functionName === 'drawingFinished') {
107
- const currentQueue = JSON.stringify(queue);
108
- if (currentQueue !== prevQueue) {
109
- for (const message of queue) {
110
- currentOverlay.dispatch(message);
111
- }
112
- }
113
- prevQueue = currentQueue;
114
- queue = [];
100
+ // TODO The logic needs to be added here once the backend starts sending this event.
115
101
  } else {
116
- queue.push(message);
102
+ currentOverlay.dispatch(message);
117
103
  }
118
104
  };
119
105
 
package/package.json CHANGED
@@ -53,5 +53,5 @@
53
53
  "unittest": "scripts/test/run_unittests.py --no-text-coverage",
54
54
  "watch": "third_party/node/node.py --output scripts/watch_build.js"
55
55
  },
56
- "version": "1.0.953165"
56
+ "version": "1.0.954163"
57
57
  }
@@ -3,16 +3,7 @@
3
3
  // found in the LICENSE file.
4
4
  'use strict';
5
5
 
6
- function isLitHtmlRenderCall(callExpressionNode) {
7
- if (callExpressionNode.callee.type !== 'MemberExpression') {
8
- return false;
9
- }
10
-
11
- // TODO: would miss cases where the render function is destructured. Should
12
- // we support that case, or enforce that it's not done?
13
- const {callee} = callExpressionNode;
14
- return callee.object?.name === 'LitHtml' && callee.property?.name === 'render';
15
- }
6
+ const {isLitHtmlRenderCall} = require('./utils.js');
16
7
 
17
8
  module.exports = {
18
9
  meta: {
@@ -26,4 +26,23 @@ function isLitHtmlTemplateCall(taggedTemplateExpressionNode) {
26
26
  return isLitHtmlDotHtmlCall || isDestructuredHtmlCall;
27
27
  }
28
28
 
29
- module.exports = {isLitHtmlTemplateCall};
29
+ /**
30
+ * @param callExpressionNode - a CallExpression node from the AST of the parsed code.
31
+ * @returns {boolean} - `true` if the code matches LitHtml.render() or render(), and false otherwise.
32
+ */
33
+ function isLitHtmlRenderCall(callExpressionNode) {
34
+ if (callExpressionNode.type !== 'CallExpression') {
35
+ throw new Error('Node of type other than CallExpresson passed to isLitHtmlRenderCall.');
36
+ }
37
+
38
+ const {callee} = callExpressionNode;
39
+ const isDestructuredRenderCall = callee.type === 'Identifier' && callee.name === 'render';
40
+ const isLitHtmlDotRenderCall = callee.object?.name === 'LitHtml' && callee.property?.name === 'render';
41
+
42
+ return isDestructuredRenderCall || isLitHtmlDotRenderCall;
43
+ }
44
+
45
+ module.exports = {
46
+ isLitHtmlTemplateCall,
47
+ isLitHtmlRenderCall
48
+ };
@@ -37,4 +37,34 @@ describe('eslint utils', () => {
37
37
  assert.strictEqual(result, false);
38
38
  });
39
39
  });
40
+
41
+ describe('isLitHtmlRenderCall', () => {
42
+ it('returns true if the code is LitHtml.render()', () => {
43
+ const code = 'LitHtml.render(LitHtml.html``, this.#shadow)';
44
+ const parsed = parser.parse(code);
45
+ const result = utils.isLitHtmlRenderCall(parsed.body[0].expression);
46
+ assert.strictEqual(result, true);
47
+ });
48
+
49
+ it('returns true if the code is render()', () => {
50
+ const code = 'render(html``, this.#shadow)';
51
+ const parsed = parser.parse(code);
52
+ const result = utils.isLitHtmlRenderCall(parsed.body[0].expression);
53
+ assert.strictEqual(result, true);
54
+ });
55
+
56
+ it('returns false if the code is not render()', () => {
57
+ const code = 'notRender(html``, this.#shadow)';
58
+ const parsed = parser.parse(code);
59
+ const result = utils.isLitHtmlRenderCall(parsed.body[0].expression);
60
+ assert.strictEqual(result, false);
61
+ });
62
+
63
+ it('returns false if the code is LitHtml.notRender()', () => {
64
+ const code = 'LitHtml.notRender(html``, this.#shadow)';
65
+ const parsed = parser.parse(code);
66
+ const result = utils.isLitHtmlRenderCall(parsed.body[0].expression);
67
+ assert.strictEqual(result, false);
68
+ });
69
+ });
40
70
  });