chrome-devtools-frontend 1.0.1004641 → 1.0.1004895

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.
@@ -1421,9 +1421,6 @@
1421
1421
  "models/issues_manager/DeprecationIssue.ts | localCSSFileExtensionRejected": {
1422
1422
  "message": "CSS cannot be loaded from file: URLs unless they end in a .css file extension."
1423
1423
  },
1424
- "models/issues_manager/DeprecationIssue.ts | mediaElementAudioSourceNode": {
1425
- "message": "Creating a MediaElementAudioSourceNode on an OfflineAudioContext is deprecated and will be removed."
1426
- },
1427
1424
  "models/issues_manager/DeprecationIssue.ts | mediaSourceAbortRemove": {
1428
1425
  "message": "Using SourceBuffer.abort() to abort remove()'s asynchronous range removal is deprecated due to specification change. Support will be removed in the future. You should instead await updateend. abort() is intended to only abort an asynchronous media append or reset parser state."
1429
1426
  },
@@ -1421,9 +1421,6 @@
1421
1421
  "models/issues_manager/DeprecationIssue.ts | localCSSFileExtensionRejected": {
1422
1422
  "message": "ĈŚŜ ćâńn̂ót̂ b́ê ĺôád̂éd̂ f́r̂óm̂ file: ÚR̂Ĺŝ ún̂ĺêśŝ t́ĥéŷ én̂d́ îń â .css f́îĺê éx̂t́êńŝíôń."
1423
1423
  },
1424
- "models/issues_manager/DeprecationIssue.ts | mediaElementAudioSourceNode": {
1425
- "message": "Ĉŕêát̂ín̂ǵ â MediaElementAudioSourceNode ón̂ án̂ OfflineAudioContext íŝ d́êṕr̂éĉát̂éd̂ án̂d́ ŵíl̂ĺ b̂é r̂ém̂óv̂éd̂."
1426
- },
1427
1424
  "models/issues_manager/DeprecationIssue.ts | mediaSourceAbortRemove": {
1428
1425
  "message": "Ûśîńĝ SourceBuffer.abort() t́ô áb̂ór̂t́ remove()'ŝ áŝýn̂ćĥŕôńôúŝ ŕâńĝé r̂ém̂óv̂ál̂ íŝ d́êṕr̂éĉát̂éd̂ d́ûé t̂ó ŝṕêćîf́îćât́îón̂ ćĥán̂ǵê. Śûṕp̂ór̂t́ ŵíl̂ĺ b̂é r̂ém̂óv̂éd̂ ín̂ t́ĥé f̂út̂úr̂é. Ŷóû śĥóûĺd̂ ín̂śt̂éâd́ âẃâít̂ updateend. abort() íŝ ín̂t́êńd̂éd̂ t́ô ón̂ĺŷ áb̂ór̂t́ âń âśŷńĉh́r̂ón̂óûś m̂éd̂íâ áp̂ṕêńd̂ ór̂ ŕêśêt́ p̂ár̂śêŕ ŝt́ât́ê."
1429
1426
  },
@@ -71,6 +71,7 @@ export class DOMNode {
71
71
  #creationStackTraceInternal: Promise<Protocol.Runtime.StackTrace|null>|null;
72
72
  pseudoElementsInternal: Map<string, DOMNode>;
73
73
  #distributedNodesInternal: DOMNodeShortcut[];
74
+ assignedSlot: DOMNodeShortcut|null;
74
75
  readonly shadowRootsInternal: DOMNode[];
75
76
  #attributesInternal: Map<string, Attribute>;
76
77
  // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
@@ -101,6 +102,7 @@ export class DOMNode {
101
102
  this.#creationStackTraceInternal = null;
102
103
  this.pseudoElementsInternal = new Map();
103
104
  this.#distributedNodesInternal = [];
105
+ this.assignedSlot = null;
104
106
  this.shadowRootsInternal = [];
105
107
  this.#attributesInternal = new Map();
106
108
  this.#markers = new Map();
@@ -181,6 +183,10 @@ export class DOMNode {
181
183
  this.setDistributedNodePayloads(payload.distributedNodes);
182
184
  }
183
185
 
186
+ if (payload.assignedSlot) {
187
+ this.setAssignedSlot(payload.assignedSlot);
188
+ }
189
+
184
190
  if (payload.children) {
185
191
  this.setChildrenPayload(payload.children);
186
192
  }
@@ -341,6 +347,10 @@ export class DOMNode {
341
347
  return this.pseudoElementsInternal.get(DOMNode.PseudoElementNames.Marker) || null;
342
348
  }
343
349
 
350
+ hasAssignedSlot(): boolean {
351
+ return this.assignedSlot !== null;
352
+ }
353
+
344
354
  isInsertionPoint(): boolean {
345
355
  return !this.isXMLNode() &&
346
356
  (this.#nodeNameInternal === 'SHADOW' || this.#nodeNameInternal === 'CONTENT' ||
@@ -680,6 +690,11 @@ export class DOMNode {
680
690
  }
681
691
  }
682
692
 
693
+ setAssignedSlot(payload: Protocol.DOM.BackendNode): void {
694
+ this.assignedSlot =
695
+ new DOMNodeShortcut(this.#domModelInternal.target(), payload.backendNodeId, payload.nodeType, payload.nodeName);
696
+ }
697
+
683
698
  private renumber(): void {
684
699
  if (!this.childrenInternal) {
685
700
  throw new Error('DOMNode._children is expected to not be null.');
@@ -3212,6 +3212,7 @@ export namespace DOM {
3212
3212
  */
3213
3213
  isSVG?: boolean;
3214
3214
  compatibilityMode?: CompatibilityMode;
3215
+ assignedSlot?: BackendNode;
3215
3216
  }
3216
3217
 
3217
3218
  /**
@@ -34,7 +34,9 @@ const UIStrings = {
34
34
  authorizationCoveredByWildcard:
35
35
  'Authorization will not be covered by the wildcard symbol (*) in CORS `Access-Control-Allow-Headers` handling.',
36
36
  /**
37
- * @description TODO(crbug.com/1320334): Description needed for translation
37
+ * @description This warning occurs when a page attempts to request a resource
38
+ * whose URL contained both a newline character (`\n` or `\r`), and a
39
+ * less-than character (`<`). These resources are blocked.
38
40
  */
39
41
  canRequestURLHTTPContainingNewline:
40
42
  'Resource requests whose URLs contained both removed whitespace `\\(n|r|t)` characters and less-than characters (`<`) are blocked. Please remove newlines and encode less-than characters from places like element attribute values in order to load these resources.',
@@ -137,11 +139,6 @@ const UIStrings = {
137
139
  */
138
140
  localCSSFileExtensionRejected:
139
141
  'CSS cannot be loaded from `file:` URLs unless they end in a `.css` file extension.',
140
- /**
141
- * @description TODO(crbug.com/1320344): Description needed for translation
142
- */
143
- mediaElementAudioSourceNode:
144
- 'Creating a `MediaElementAudioSourceNode` on an `OfflineAudioContext` is deprecated and will be removed.',
145
142
  /**
146
143
  * @description TODO(crbug.com/1320345): Description needed for translation
147
144
  */
@@ -415,11 +412,6 @@ export class DeprecationIssue extends Issue {
415
412
  messageFunction = i18nLazyString(UIStrings.localCSSFileExtensionRejected);
416
413
  milestone = 64;
417
414
  break;
418
- case Protocol.Audits.DeprecationIssueType.MediaElementAudioSourceNode:
419
- messageFunction = i18nLazyString(UIStrings.mediaElementAudioSourceNode);
420
- feature = 5258622686724096;
421
- milestone = 71;
422
- break;
423
415
  case Protocol.Audits.DeprecationIssueType.MediaSourceAbortRemove:
424
416
  messageFunction = i18nLazyString(UIStrings.mediaSourceAbortRemove);
425
417
  feature = 6107495151960064;
@@ -41,6 +41,7 @@ import * as TextUtils from '../../models/text_utils/text_utils.js';
41
41
  import * as CodeMirror from '../../third_party/codemirror.next/codemirror.next.js';
42
42
  import * as Adorners from '../../ui/components/adorners/adorners.js';
43
43
  import * as CodeHighlighter from '../../ui/components/code_highlighter/code_highlighter.js';
44
+ import * as IconButton from '../../ui/components/icon_button/icon_button.js';
44
45
  import * as TextEditor from '../../ui/components/text_editor/text_editor.js';
45
46
  import * as Components from '../../ui/legacy/components/utils/utils.js';
46
47
  import * as UI from '../../ui/legacy/legacy.js';
@@ -237,6 +238,7 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
237
238
  private searchHighlightsVisible?: boolean;
238
239
  selectionElement?: HTMLDivElement;
239
240
  private hintElement?: HTMLElement;
241
+ #slot?: Adorners.Adorner.Adorner;
240
242
  private contentElement: HTMLElement;
241
243
 
242
244
  constructor(node: SDK.DOMModel.DOMNode, isClosingTag?: boolean) {
@@ -422,6 +424,21 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
422
424
  this.expandedChildrenLimitInternal = expandedChildrenLimit;
423
425
  }
424
426
 
427
+ createSlotLink(nodeShortcut: SDK.DOMModel.DOMNodeShortcut|null): void {
428
+ if (nodeShortcut) {
429
+ const config = ElementsComponents.AdornerManager.getRegisteredAdorner(
430
+ ElementsComponents.AdornerManager.RegisteredAdorners.SLOT);
431
+ this.#slot = this.adornSlot(config);
432
+ const deferredNode = nodeShortcut.deferredNode;
433
+ this.#slot.addEventListener('click', () => {
434
+ deferredNode.resolve(node => {
435
+ void Common.Revealer.reveal(node);
436
+ });
437
+ });
438
+ this.#slot.addEventListener('mousedown', e => e.consume(), false);
439
+ }
440
+ }
441
+
425
442
  private createSelection(): void {
426
443
  const contentElement = this.contentElement;
427
444
  if (!contentElement) {
@@ -1314,6 +1331,9 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
1314
1331
  if (!this.isClosingTagInternal && this.adornerContainer) {
1315
1332
  this.contentElement.append(this.adornerContainer);
1316
1333
  }
1334
+ if (this.#slot) {
1335
+ this.contentElement.append(this.#slot);
1336
+ }
1317
1337
  this.highlightResult = [];
1318
1338
  delete this.selectionElement;
1319
1339
  delete this.hintElement;
@@ -1936,6 +1956,27 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
1936
1956
  return adorner;
1937
1957
  }
1938
1958
 
1959
+ adornSlot({name}: {name: string}): Adorners.Adorner.Adorner {
1960
+ const linkIcon = new IconButton.Icon.Icon();
1961
+ linkIcon
1962
+ .data = {iconName: 'ic_show_node_16x16', color: 'var(--color-text-disabled)', width: '12px', height: '12px'};
1963
+ const slotText = document.createElement('span');
1964
+ slotText.textContent = name;
1965
+ const adornerContent = document.createElement('span');
1966
+ adornerContent.append(linkIcon);
1967
+ adornerContent.append(slotText);
1968
+ adornerContent.classList.add('adorner-with-icon');
1969
+ const adorner = new Adorners.Adorner.Adorner();
1970
+ adorner.data = {
1971
+ name,
1972
+ content: adornerContent,
1973
+ };
1974
+ this.adorners.push(adorner);
1975
+ ElementsPanel.instance().registerAdorner(adorner);
1976
+ this.updateAdorners();
1977
+ return adorner;
1978
+ }
1979
+
1939
1980
  removeAdorner(adornerToRemove: Adorners.Adorner.Adorner): void {
1940
1981
  const adorners = this.adorners;
1941
1982
  ElementsPanel.instance().deregisterAdorner(adornerToRemove);
@@ -1180,6 +1180,11 @@ export class ElementsTreeOutline extends
1180
1180
  !node.parentNode.parentNode) {
1181
1181
  treeElement.setCollapsible(false);
1182
1182
  }
1183
+
1184
+ if (node.hasAssignedSlot()) {
1185
+ treeElement.createSlotLink(node.assignedSlot);
1186
+ }
1187
+
1183
1188
  treeElement.selectable = Boolean(this.selectEnabled);
1184
1189
  return treeElement;
1185
1190
  }
@@ -29,6 +29,7 @@ export enum RegisteredAdorners {
29
29
  AD = 'ad',
30
30
  SCROLL_SNAP = 'scroll-snap',
31
31
  CONTAINER = 'container',
32
+ SLOT = 'slot',
32
33
  }
33
34
 
34
35
  // This enum-like const object serves as the authoritative registry for all the
@@ -65,6 +66,12 @@ export function getRegisteredAdorner(which: RegisteredAdorners): RegisteredAdorn
65
66
  category: AdornerCategories.LAYOUT,
66
67
  enabledByDefault: true,
67
68
  };
69
+ case RegisteredAdorners.SLOT:
70
+ return {
71
+ name: 'slot',
72
+ category: AdornerCategories.LAYOUT,
73
+ enabledByDefault: true,
74
+ };
68
75
  }
69
76
  }
70
77
 
@@ -27,6 +27,15 @@
27
27
  display: none;
28
28
  }
29
29
 
30
+ .adorner-with-icon {
31
+ display: flex;
32
+ justify-content: center;
33
+ }
34
+
35
+ .adorner-with-icon *:not(:last-child) {
36
+ margin-right: 2px;
37
+ }
38
+
30
39
  .elements-disclosure {
31
40
  width: 100%;
32
41
  display: inline-block;
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.1004641"
58
+ "version": "1.0.1004895"
59
59
  }