chrome-devtools-frontend 1.0.1018569 → 1.0.1019968

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 (40) hide show
  1. package/config/gni/devtools_grd_files.gni +3 -0
  2. package/front_end/core/i18n/locales/en-US.json +7 -1
  3. package/front_end/core/i18n/locales/en-XL.json +7 -1
  4. package/front_end/core/sdk/CSSMatchedStyles.ts +1 -1
  5. package/front_end/core/sdk/CSSModel.ts +22 -0
  6. package/front_end/core/sdk/CSSQuery.ts +2 -1
  7. package/front_end/core/sdk/CSSRule.ts +4 -0
  8. package/front_end/core/sdk/CSSScope.ts +30 -0
  9. package/front_end/core/sdk/sdk.ts +2 -0
  10. package/front_end/entrypoints/inspector_main/RenderingOptions.ts +7 -6
  11. package/front_end/entrypoints/inspector_main/inspector_main-meta.ts +1 -1
  12. package/front_end/generated/InspectorBackendCommands.js +13 -3
  13. package/front_end/generated/SupportedCSSProperties.js +2 -2
  14. package/front_end/generated/protocol-mapping.d.ts +5 -0
  15. package/front_end/generated/protocol-proxy-api.d.ts +5 -0
  16. package/front_end/generated/protocol.ts +43 -0
  17. package/front_end/models/bindings/BreakpointManager.ts +22 -14
  18. package/front_end/models/javascript_metadata/NativeFunctions.js +4 -19
  19. package/front_end/panels/elements/CSSRuleValidator.ts +100 -0
  20. package/front_end/panels/elements/ElementsTreeOutline.ts +44 -8
  21. package/front_end/panels/elements/StylePropertiesSection.ts +35 -3
  22. package/front_end/panels/elements/StylePropertyTreeElement.ts +59 -0
  23. package/front_end/panels/elements/StylesSidebarPane.ts +28 -8
  24. package/front_end/panels/elements/TopLayerContainer.ts +9 -1
  25. package/front_end/panels/elements/components/AdornerManager.ts +7 -0
  26. package/front_end/panels/elements/elements.ts +3 -0
  27. package/front_end/panels/elements/elementsTreeOutline.css +4 -0
  28. package/front_end/panels/elements/stylesSectionTree.css +10 -0
  29. package/front_end/panels/emulation/DeviceModeToolbar.ts +1 -0
  30. package/front_end/panels/network/components/RequestHeadersView.ts +16 -16
  31. package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspector.ts +23 -1
  32. package/front_end/ui/components/linear_memory_inspector/LinearMemoryViewer.ts +18 -1
  33. package/front_end/ui/components/linear_memory_inspector/LinearMemoryViewerUtils.ts +8 -0
  34. package/front_end/ui/components/linear_memory_inspector/linearMemoryViewer.css +4 -0
  35. package/front_end/ui/components/linear_memory_inspector/linear_memory_inspector.ts +2 -0
  36. package/front_end/ui/components/node_text/nodeText.css +5 -5
  37. package/front_end/ui/components/panel_feedback/PreviewToggle.ts +1 -8
  38. package/front_end/ui/components/panel_feedback/previewToggle.css +1 -7
  39. package/front_end/ui/components/tree_outline/treeOutline.css +1 -0
  40. package/package.json +1 -1
@@ -4,6 +4,7 @@
4
4
  import * as LitHtml from '../../lit-html/lit-html.js';
5
5
  import * as ComponentHelpers from '../helpers/helpers.js';
6
6
 
7
+ import type {HighlightInfo} from './LinearMemoryViewerUtils.js';
7
8
  import {toHexString} from './LinearMemoryInspectorUtils.js';
8
9
  import linearMemoryViewerStyles from './linearMemoryViewer.css.js';
9
10
 
@@ -14,6 +15,7 @@ export interface LinearMemoryViewerData {
14
15
  address: number;
15
16
  memoryOffset: number;
16
17
  focus: boolean;
18
+ highlightInfo?: HighlightInfo;
17
19
  }
18
20
 
19
21
  export class ByteSelectedEvent extends Event {
@@ -50,6 +52,10 @@ export class LinearMemoryViewer extends HTMLElement {
50
52
  #memory = new Uint8Array();
51
53
  #address = 0;
52
54
  #memoryOffset = 0;
55
+ #highlightInfo: HighlightInfo = {
56
+ size: 0,
57
+ startAddress: 0,
58
+ };
53
59
 
54
60
  #numRows = 1;
55
61
  #numBytesInRow = BYTE_GROUP_SIZE;
@@ -69,6 +75,7 @@ export class LinearMemoryViewer extends HTMLElement {
69
75
 
70
76
  this.#memory = data.memory;
71
77
  this.#address = data.address;
78
+ this.#highlightInfo = data.highlightInfo || this.#highlightInfo;
72
79
  this.#memoryOffset = data.memoryOffset;
73
80
  this.#focusOnByte = data.focus;
74
81
  this.#update();
@@ -230,18 +237,20 @@ export class LinearMemoryViewer extends HTMLElement {
230
237
  #renderByteValues(startIndex: number, endIndex: number): LitHtml.TemplateResult {
231
238
  const cells = [];
232
239
  for (let i = startIndex; i < endIndex; ++i) {
240
+ const actualIndex = i + this.#memoryOffset;
233
241
  // Add margin after each group of bytes of size byteGroupSize.
234
242
  const addMargin = i !== startIndex && (i - startIndex) % BYTE_GROUP_SIZE === 0;
235
243
  const selected = i === this.#address - this.#memoryOffset;
244
+ const shouldBeHighlighted = this.#shouldBeHighlighted(actualIndex);
236
245
  const classMap = {
237
246
  'cell': true,
238
247
  'byte-cell': true,
239
248
  'byte-group-margin': addMargin,
240
249
  selected,
250
+ 'highlight-area': shouldBeHighlighted,
241
251
  };
242
252
  const isSelectableCell = i < this.#memory.length;
243
253
  const byteValue = isSelectableCell ? html`${toHexString({number: this.#memory[i], pad: 2, prefix: false})}` : '';
244
- const actualIndex = i + this.#memoryOffset;
245
254
  const onSelectedByte = isSelectableCell ? this.#onSelectedByte.bind(this, actualIndex) : '';
246
255
  cells.push(html`<span class=${LitHtml.Directives.classMap(classMap)} @click=${onSelectedByte}>${byteValue}</span>`);
247
256
  }
@@ -251,10 +260,13 @@ export class LinearMemoryViewer extends HTMLElement {
251
260
  #renderCharacterValues(startIndex: number, endIndex: number): LitHtml.TemplateResult {
252
261
  const cells = [];
253
262
  for (let i = startIndex; i < endIndex; ++i) {
263
+ const actualIndex = i + this.#memoryOffset;
264
+ const shouldBeHighlighted = this.#shouldBeHighlighted(actualIndex);
254
265
  const classMap = {
255
266
  'cell': true,
256
267
  'text-cell': true,
257
268
  selected: this.#address - this.#memoryOffset === i,
269
+ 'highlight-area': shouldBeHighlighted,
258
270
  };
259
271
  const isSelectableCell = i < this.#memory.length;
260
272
  const value = isSelectableCell ? html`${this.#toAscii(this.#memory[i])}` : '';
@@ -274,6 +286,11 @@ export class LinearMemoryViewer extends HTMLElement {
274
286
  #onSelectedByte(index: number): void {
275
287
  this.dispatchEvent(new ByteSelectedEvent(index));
276
288
  }
289
+
290
+ #shouldBeHighlighted(index: number): boolean {
291
+ return this.#highlightInfo.startAddress <= index
292
+ && index < this.#highlightInfo.startAddress + this.#highlightInfo.size;
293
+ }
277
294
  }
278
295
 
279
296
  ComponentHelpers.CustomElements.defineComponent('devtools-linear-memory-inspector-viewer', LinearMemoryViewer);
@@ -0,0 +1,8 @@
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
+ export interface HighlightInfo {
6
+ startAddress: number;
7
+ size: number;
8
+ }
@@ -36,6 +36,10 @@
36
36
  background-color: var(--legacy-item-selection-bg-color);
37
37
  }
38
38
 
39
+ .highlight-area {
40
+ background-color: var(--legacy-item-selection-bg-color);
41
+ }
42
+
39
43
  .byte-cell {
40
44
  min-width: 21px;
41
45
  color: var(--color-text-primary);
@@ -9,6 +9,7 @@ import * as LinearMemoryInspectorUtils from './LinearMemoryInspectorUtils.js';
9
9
  import * as LinearMemoryNavigator from './LinearMemoryNavigator.js';
10
10
  import * as LinearMemoryValueInterpreter from './LinearMemoryValueInterpreter.js';
11
11
  import * as LinearMemoryViewer from './LinearMemoryViewer.js';
12
+ import * as LinearMemoryViewerUtils from './LinearMemoryViewerUtils.js';
12
13
  import * as ValueInterpreterDisplay from './ValueInterpreterDisplay.js';
13
14
  import * as ValueInterpreterDisplayUtils from './ValueInterpreterDisplayUtils.js';
14
15
  import * as ValueInterpreterSettings from './ValueInterpreterSettings.js';
@@ -21,6 +22,7 @@ export {
21
22
  LinearMemoryNavigator,
22
23
  LinearMemoryValueInterpreter,
23
24
  LinearMemoryViewer,
25
+ LinearMemoryViewerUtils,
24
26
  ValueInterpreterDisplay,
25
27
  ValueInterpreterDisplayUtils,
26
28
  ValueInterpreterSettings,
@@ -7,21 +7,21 @@
7
7
  /* See: https://crbug.com/1227651 for details on changing these to --override pattern. */
8
8
 
9
9
  .node-label-name {
10
- color: var(--override-node-text-label-color, --color-token-tag);
10
+ color: var(--override-node-text-label-color, var(--color-token-tag));
11
11
  }
12
12
 
13
13
  .node-label-class {
14
- color: var(--override-node-text-class-color, --color-token-attribute);
14
+ color: var(--override-node-text-class-color, var(--color-token-attribute));
15
15
  }
16
16
 
17
17
  .node-label-id {
18
- color: var(--override-node-text-id-color);
18
+ color: var(--override-node-text-id-color, var(--color-token-attribute));
19
19
  }
20
20
 
21
21
  .node-label-class.node-multiple-descriptors {
22
- color: var(--override-node-text-multiple-descriptors-class, var(--override-node-text-class-color, --color-token-attribute));
22
+ color: var(--override-node-text-multiple-descriptors-class, var(--override-node-text-class-color, var(--color-token-attribute)));
23
23
  }
24
24
 
25
25
  .node-label-id.node-multiple-descriptors {
26
- color: var(--override-node-text-multiple-descriptors-id, var(--override-node-text-id-color, --color-token-attribute));
26
+ color: var(--override-node-text-multiple-descriptors-id, var(--override-node-text-id-color, var(--color-token-attribute)));
27
27
  }
@@ -67,18 +67,11 @@ export class PreviewToggle extends HTMLElement {
67
67
 
68
68
  #render(): void {
69
69
  const checked = Root.Runtime.experiments.isEnabled(this.#experiment);
70
- const hasLink = Boolean(this.#feedbackURL) || Boolean(this.#learnMoreURL);
71
-
72
- const containerClasses = LitHtml.Directives.classMap({
73
- 'container': true,
74
- 'has-link': hasLink,
75
- });
76
-
77
70
  // Disabled until https://crbug.com/1079231 is fixed.
78
71
  // clang-format off
79
72
  render(
80
73
  html`
81
- <div class=${containerClasses}>
74
+ <div class="container">
82
75
  <div class="checkbox-line">
83
76
  <label class="experiment-preview">
84
77
  <input type="checkbox" ?checked=${checked} @change=${this.#checkboxChanged} aria-label=${this.#name}/>
@@ -33,16 +33,10 @@
33
33
  padding: 4px;
34
34
  }
35
35
 
36
- .container.has-link {
37
- /* For x-link outline not to paint over the helper text
38
- we need to have 2 * <padding>px additional line height */
39
- line-height: calc(1em + 8px);
40
- }
41
-
42
36
  .x-link {
43
37
  color: var(--color-primary);
44
38
  text-decoration-line: underline;
45
- padding: 4px;
39
+ margin: 4px;
46
40
  }
47
41
 
48
42
  .feedback .x-link {
@@ -38,6 +38,7 @@ li {
38
38
  height: 12px;
39
39
  width: 13px;
40
40
  overflow: hidden;
41
+ flex: none;
41
42
  }
42
43
 
43
44
  ul {
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.1018569"
58
+ "version": "1.0.1019968"
59
59
  }