chrome-devtools-frontend 1.0.996044 → 1.0.997598

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 (33) hide show
  1. package/AUTHORS +2 -0
  2. package/front_end/core/i18n/locales/en-US.json +102 -0
  3. package/front_end/core/i18n/locales/en-XL.json +102 -0
  4. package/front_end/core/root/Runtime.ts +5 -0
  5. package/front_end/core/sdk/CSSMatchedStyles.ts +158 -33
  6. package/front_end/core/sdk/CSSMetadata.ts +1 -8
  7. package/front_end/core/sdk/DebuggerModel.ts +1 -1
  8. package/front_end/core/sdk/NetworkManager.ts +1 -2
  9. package/front_end/generated/InspectorBackendCommands.js +33 -3
  10. package/front_end/generated/protocol.ts +47 -24
  11. package/front_end/models/bindings/BreakpointManager.ts +12 -3
  12. package/front_end/models/issues_manager/DeprecationIssue.ts +281 -24
  13. package/front_end/panels/changes/ChangesView.ts +25 -10
  14. package/front_end/panels/css_overview/cssOverview.css +4 -0
  15. package/front_end/panels/elements/ElementsPanel.ts +7 -6
  16. package/front_end/panels/elements/StylesSidebarPane.ts +55 -21
  17. package/front_end/panels/elements/components/adornerSettingsPane.css +5 -0
  18. package/front_end/panels/elements/stylesSectionTree.css +5 -4
  19. package/front_end/panels/elements/stylesSidebarPane.css +1 -1
  20. package/front_end/panels/profiler/HeapSnapshotGridNodes.ts +1 -0
  21. package/front_end/panels/sources/DebuggerPlugin.ts +6 -2
  22. package/front_end/panels/sources/SourcesPanel.ts +22 -6
  23. package/front_end/panels/sources/sources-legacy.ts +1 -1
  24. package/front_end/panels/sources/sources-meta.ts +61 -7
  25. package/front_end/ui/components/diff_view/diffView.css +2 -0
  26. package/front_end/ui/components/tree_outline/TreeOutline.ts +18 -7
  27. package/front_end/ui/legacy/SplitWidget.ts +17 -7
  28. package/front_end/ui/legacy/Toolbar.ts +5 -0
  29. package/front_end/ui/legacy/softDropDownButton.css +4 -0
  30. package/package.json +1 -1
  31. package/scripts/eslint_rules/lib/inline_type_imports.js +158 -0
  32. package/scripts/eslint_rules/tests/inline_type_imports_test.js +106 -0
  33. package/scripts/javascript_natives/index.js +1 -2
@@ -2,10 +2,11 @@
2
2
  // Use of this source code is governed by a BSD-style license that can be
3
3
  // found in the LICENSE file.
4
4
 
5
+ import * as Protocol from '../../generated/protocol.js';
5
6
  import * as TextUtils from '../../models/text_utils/text_utils.js';
6
- import type * as Protocol from '../../generated/protocol.js';
7
7
 
8
8
  import {cssMetadata, CustomVariableRegex, VariableRegex} from './CSSMetadata.js';
9
+
9
10
  import type {CSSModel} from './CSSModel.js';
10
11
  import type {CSSProperty} from './CSSProperty.js';
11
12
  import {CSSKeyframesRule, CSSStyleRule} from './CSSRule.js';
@@ -22,6 +23,7 @@ export class CSSMatchedStyles {
22
23
  readonly #inheritedStyles: Set<CSSStyleDeclaration>;
23
24
  readonly #mainDOMCascade: DOMInheritanceCascade;
24
25
  readonly #pseudoDOMCascades: Map<Protocol.DOM.PseudoType, DOMInheritanceCascade>;
26
+ readonly #customHighlightPseudoDOMCascades: Map<string, DOMInheritanceCascade>;
25
27
  readonly #styleToDOMCascade: Map<CSSStyleDeclaration, DOMInheritanceCascade>;
26
28
 
27
29
  constructor(
@@ -48,10 +50,13 @@ export class CSSMatchedStyles {
48
50
  }
49
51
 
50
52
  this.#mainDOMCascade = this.buildMainCascade(inlinePayload, attributesPayload, matchedPayload, inheritedPayload);
51
- this.#pseudoDOMCascades = this.buildPseudoCascades(pseudoPayload, inheritedPseudoPayload);
53
+ [this.#pseudoDOMCascades, this.#customHighlightPseudoDOMCascades] =
54
+ this.buildPseudoCascades(pseudoPayload, inheritedPseudoPayload);
52
55
 
53
56
  this.#styleToDOMCascade = new Map();
54
- for (const domCascade of Array.from(this.#pseudoDOMCascades.values()).concat(this.#mainDOMCascade)) {
57
+ for (const domCascade of Array.from(this.#customHighlightPseudoDOMCascades.values())
58
+ .concat(Array.from(this.#pseudoDOMCascades.values()))
59
+ .concat(this.#mainDOMCascade)) {
55
60
  for (const style of domCascade.styles()) {
56
61
  this.#styleToDOMCascade.set(style, domCascade);
57
62
  }
@@ -206,36 +211,133 @@ export class CSSMatchedStyles {
206
211
  }
207
212
  }
208
213
 
214
+ /**
215
+ * Pseudo rule matches received via the inspector protocol are grouped by pseudo type.
216
+ * For custom highlight pseudos, we need to instead group the rule matches by highlight
217
+ * name in order to produce separate cascades for each highlight name. This is necessary
218
+ * so that styles of ::highlight(foo) are not shown as overriding styles of ::highlight(bar).
219
+ *
220
+ * This helper function takes a list of rule matches and generates separate NodeCascades
221
+ * for each custom highlight name that was matched.
222
+ */
223
+ private buildSplitCustomHighlightCascades(
224
+ rules: Protocol.CSS.RuleMatch[], node: DOMNode, isInherited: boolean,
225
+ pseudoCascades: Map<string, NodeCascade[]>): void {
226
+ const splitHighlightRules = new Map<string, CSSStyleDeclaration[]>();
227
+
228
+ for (let j = rules.length - 1; j >= 0; --j) {
229
+ const highlightNamesToMatchingSelectorIndices = this.customHighlightNamesToMatchingSelectorIndices(rules[j]);
230
+
231
+ for (const [highlightName, matchingSelectors] of highlightNamesToMatchingSelectorIndices) {
232
+ const pseudoRule = new CSSStyleRule(this.#cssModelInternal, rules[j].rule);
233
+ this.#nodeForStyleInternal.set(pseudoRule.style, node);
234
+ if (isInherited) {
235
+ this.#inheritedStyles.add(pseudoRule.style);
236
+ }
237
+ this.addMatchingSelectors(node, pseudoRule, matchingSelectors);
238
+
239
+ const ruleListForHighlightName = splitHighlightRules.get(highlightName);
240
+ if (ruleListForHighlightName) {
241
+ ruleListForHighlightName.push(pseudoRule.style);
242
+ } else {
243
+ splitHighlightRules.set(highlightName, [pseudoRule.style]);
244
+ }
245
+ }
246
+ }
247
+
248
+ for (const [highlightName, highlightStyles] of splitHighlightRules) {
249
+ const nodeCascade = new NodeCascade(this, highlightStyles, isInherited, true /* #isHighlightPseudoCascade*/);
250
+ const cascadeListForHighlightName = pseudoCascades.get(highlightName);
251
+ if (cascadeListForHighlightName) {
252
+ cascadeListForHighlightName.push(nodeCascade);
253
+ } else {
254
+ pseudoCascades.set(highlightName, [nodeCascade]);
255
+ }
256
+ }
257
+ }
258
+
259
+ /**
260
+ * Return a mapping of the highlight names in the specified RuleMatch to
261
+ * the indices of selectors in that selector list with that highlight name.
262
+ *
263
+ * For example, consider the following ruleset:
264
+ * span::highlight(foo), div, #mySpan::highlight(bar), .highlighted::highlight(foo) {
265
+ * color: blue;
266
+ * }
267
+ *
268
+ * For a <span id="mySpan" class="highlighted"></span>, a RuleMatch for that span
269
+ * would have matchingSelectors [0, 2, 3] indicating that the span
270
+ * matches all of the highlight selectors.
271
+ *
272
+ * For that RuleMatch, this function would produce the following map:
273
+ * {
274
+ * "foo": [0, 3],
275
+ * "bar": [2]
276
+ * }
277
+ *
278
+ * @param ruleMatch
279
+ * @returns A mapping of highlight names to lists of indices into the selector
280
+ * list associated with ruleMatch. The indices correspond to the selectors in the rule
281
+ * associated with the key's highlight name.
282
+ */
283
+ private customHighlightNamesToMatchingSelectorIndices(ruleMatch: Protocol.CSS.RuleMatch): Map<string, number[]> {
284
+ const highlightNamesToMatchingSelectors = new Map<string, number[]>();
285
+
286
+ for (let i = 0; i < ruleMatch.matchingSelectors.length; i++) {
287
+ const matchingSelectorIndex = ruleMatch.matchingSelectors[i];
288
+ const selectorText = ruleMatch.rule.selectorList.selectors[matchingSelectorIndex].text;
289
+ const highlightNameMatch = selectorText.match(/::highlight\((.*)\)/);
290
+ if (highlightNameMatch) {
291
+ const highlightName = highlightNameMatch[1];
292
+ const selectorsForName = highlightNamesToMatchingSelectors.get(highlightName);
293
+ if (selectorsForName) {
294
+ selectorsForName.push(matchingSelectorIndex);
295
+ } else {
296
+ highlightNamesToMatchingSelectors.set(highlightName, [matchingSelectorIndex]);
297
+ }
298
+ }
299
+ }
300
+ return highlightNamesToMatchingSelectors;
301
+ }
302
+
209
303
  private buildPseudoCascades(
210
304
  pseudoPayload: Protocol.CSS.PseudoElementMatches[],
211
305
  inheritedPseudoPayload: Protocol.CSS.InheritedPseudoElementMatches[]):
212
- Map<Protocol.DOM.PseudoType, DOMInheritanceCascade> {
306
+ [Map<Protocol.DOM.PseudoType, DOMInheritanceCascade>, Map<string, DOMInheritanceCascade>] {
213
307
  const pseudoInheritanceCascades = new Map<Protocol.DOM.PseudoType, DOMInheritanceCascade>();
308
+ const customHighlightPseudoInheritanceCascades = new Map<string, DOMInheritanceCascade>();
214
309
  if (!pseudoPayload) {
215
- return pseudoInheritanceCascades;
310
+ return [pseudoInheritanceCascades, customHighlightPseudoInheritanceCascades];
216
311
  }
217
312
 
218
313
  const pseudoCascades = new Map<Protocol.DOM.PseudoType, NodeCascade[]>();
314
+ const customHighlightPseudoCascades = new Map<string, NodeCascade[]>();
219
315
  for (let i = 0; i < pseudoPayload.length; ++i) {
220
316
  const entryPayload = pseudoPayload[i];
221
317
  // PseudoElement nodes are not created unless "content" css property is set.
222
318
  const pseudoElement = this.#nodeInternal.pseudoElements().get(entryPayload.pseudoType) || null;
223
319
  const pseudoStyles = [];
224
320
  const rules = entryPayload.matches || [];
225
- for (let j = rules.length - 1; j >= 0; --j) {
226
- const pseudoRule = new CSSStyleRule(this.#cssModelInternal, rules[j].rule);
227
- pseudoStyles.push(pseudoRule.style);
228
- const nodeForStyle =
229
- cssMetadata().isHighlightPseudoType(entryPayload.pseudoType) ? this.#nodeInternal : pseudoElement;
230
- this.#nodeForStyleInternal.set(pseudoRule.style, nodeForStyle);
231
- if (nodeForStyle) {
232
- this.addMatchingSelectors(nodeForStyle, pseudoRule, rules[j].matchingSelectors);
321
+
322
+ if (entryPayload.pseudoType === Protocol.DOM.PseudoType.Highlight) {
323
+ this.buildSplitCustomHighlightCascades(
324
+ rules, this.#nodeInternal, false /* #isInherited */, customHighlightPseudoCascades);
325
+ } else {
326
+ for (let j = rules.length - 1; j >= 0; --j) {
327
+ const pseudoRule = new CSSStyleRule(this.#cssModelInternal, rules[j].rule);
328
+ pseudoStyles.push(pseudoRule.style);
329
+ const nodeForStyle =
330
+ cssMetadata().isHighlightPseudoType(entryPayload.pseudoType) ? this.#nodeInternal : pseudoElement;
331
+ this.#nodeForStyleInternal.set(pseudoRule.style, nodeForStyle);
332
+ if (nodeForStyle) {
333
+ this.addMatchingSelectors(nodeForStyle, pseudoRule, rules[j].matchingSelectors);
334
+ }
233
335
  }
336
+ const isHighlightPseudoCascade = cssMetadata().isHighlightPseudoType(entryPayload.pseudoType);
337
+ const nodeCascade = new NodeCascade(
338
+ this, pseudoStyles, false /* #isInherited */, isHighlightPseudoCascade /* #isHighlightPseudoCascade*/);
339
+ pseudoCascades.set(entryPayload.pseudoType, [nodeCascade]);
234
340
  }
235
- const isHighlightPseudoCascade = cssMetadata().isHighlightPseudoType(entryPayload.pseudoType);
236
- const nodeCascade = new NodeCascade(
237
- this, pseudoStyles, false /* #isInherited */, isHighlightPseudoCascade /* #isHighlightPseudoCascade*/);
238
- pseudoCascades.set(entryPayload.pseudoType, [nodeCascade]);
239
341
  }
240
342
 
241
343
  if (inheritedPseudoPayload) {
@@ -244,24 +346,30 @@ export class CSSMatchedStyles {
244
346
  const inheritedPseudoMatches = inheritedPseudoPayload[i].pseudoElements;
245
347
  for (let j = 0; j < inheritedPseudoMatches.length; ++j) {
246
348
  const inheritedEntryPayload = inheritedPseudoMatches[j];
247
- const pseudoStyles = [];
248
349
  const rules = inheritedEntryPayload.matches || [];
249
- for (let k = rules.length - 1; k >= 0; --k) {
250
- const pseudoRule = new CSSStyleRule(this.#cssModelInternal, rules[k].rule);
251
- pseudoStyles.push(pseudoRule.style);
252
- this.#nodeForStyleInternal.set(pseudoRule.style, parentNode);
253
- this.#inheritedStyles.add(pseudoRule.style);
254
- this.addMatchingSelectors(parentNode, pseudoRule, rules[k].matchingSelectors);
255
- }
256
350
 
257
- const isHighlightPseudoCascade = cssMetadata().isHighlightPseudoType(inheritedEntryPayload.pseudoType);
258
- const nodeCascade = new NodeCascade(
259
- this, pseudoStyles, true /* #isInherited */, isHighlightPseudoCascade /* #isHighlightPseudoCascade*/);
260
- const cascadeListForPseudoType = pseudoCascades.get(inheritedEntryPayload.pseudoType);
261
- if (cascadeListForPseudoType) {
262
- cascadeListForPseudoType.push(nodeCascade);
351
+ if (inheritedEntryPayload.pseudoType === Protocol.DOM.PseudoType.Highlight) {
352
+ this.buildSplitCustomHighlightCascades(
353
+ rules, parentNode, true /* #isInherited */, customHighlightPseudoCascades);
263
354
  } else {
264
- pseudoCascades.set(inheritedEntryPayload.pseudoType, [nodeCascade]);
355
+ const pseudoStyles = [];
356
+ for (let k = rules.length - 1; k >= 0; --k) {
357
+ const pseudoRule = new CSSStyleRule(this.#cssModelInternal, rules[k].rule);
358
+ pseudoStyles.push(pseudoRule.style);
359
+ this.#nodeForStyleInternal.set(pseudoRule.style, parentNode);
360
+ this.#inheritedStyles.add(pseudoRule.style);
361
+ this.addMatchingSelectors(parentNode, pseudoRule, rules[k].matchingSelectors);
362
+ }
363
+
364
+ const isHighlightPseudoCascade = cssMetadata().isHighlightPseudoType(inheritedEntryPayload.pseudoType);
365
+ const nodeCascade = new NodeCascade(
366
+ this, pseudoStyles, true /* #isInherited */, isHighlightPseudoCascade /* #isHighlightPseudoCascade*/);
367
+ const cascadeListForPseudoType = pseudoCascades.get(inheritedEntryPayload.pseudoType);
368
+ if (cascadeListForPseudoType) {
369
+ cascadeListForPseudoType.push(nodeCascade);
370
+ } else {
371
+ pseudoCascades.set(inheritedEntryPayload.pseudoType, [nodeCascade]);
372
+ }
265
373
  }
266
374
  }
267
375
 
@@ -275,7 +383,11 @@ export class CSSMatchedStyles {
275
383
  pseudoInheritanceCascades.set(pseudoType, new DOMInheritanceCascade(nodeCascade));
276
384
  }
277
385
 
278
- return pseudoInheritanceCascades;
386
+ for (const [highlightName, nodeCascade] of customHighlightPseudoCascades.entries()) {
387
+ customHighlightPseudoInheritanceCascades.set(highlightName, new DOMInheritanceCascade(nodeCascade));
388
+ }
389
+
390
+ return [pseudoInheritanceCascades, customHighlightPseudoInheritanceCascades];
279
391
  }
280
392
 
281
393
  private addMatchingSelectors(
@@ -405,6 +517,15 @@ export class CSSMatchedStyles {
405
517
  return new Set(this.#pseudoDOMCascades.keys());
406
518
  }
407
519
 
520
+ customHighlightPseudoStyles(highlightName: string): CSSStyleDeclaration[] {
521
+ const domCascade = this.#customHighlightPseudoDOMCascades.get(highlightName);
522
+ return domCascade ? domCascade.styles() : [];
523
+ }
524
+
525
+ customHighlightPseudoNames(): Set<string> {
526
+ return new Set(this.#customHighlightPseudoDOMCascades.keys());
527
+ }
528
+
408
529
  private containsInherited(style: CSSStyleDeclaration): boolean {
409
530
  const properties = style.allProperties();
410
531
  for (let i = 0; i < properties.length; ++i) {
@@ -462,6 +583,10 @@ export class CSSMatchedStyles {
462
583
  for (const domCascade of this.#pseudoDOMCascades.values()) {
463
584
  domCascade.reset();
464
585
  }
586
+
587
+ for (const domCascade of this.#customHighlightPseudoDOMCascades.values()) {
588
+ domCascade.reset();
589
+ }
465
590
  }
466
591
  }
467
592
 
@@ -313,15 +313,8 @@ export class CSSMetadata {
313
313
  }
314
314
 
315
315
  isHighlightPseudoType(pseudoType: Protocol.DOM.PseudoType): boolean {
316
- // TODO(crbug.com/1164461) Currently devtools-frontend groups all custom highlight
317
- // pseudos together in the same pseudo cascade, regardless of highlight name. This means that
318
- // the result of displaying "overloaded" highlight styles as crossed-out can produce
319
- // misleading results, because properties from highlights with one name can be shown as overloaded by
320
- // properties from highlights with another name.
321
- // So until that is fixed, don't include custom highlights among the highlight pseudos
322
- // for which we apply overloaded property annotations.
323
316
  return (
324
- /* pseudoType === Protocol.DOM.PseudoType.Highlight || */ pseudoType === Protocol.DOM.PseudoType.Selection ||
317
+ pseudoType === Protocol.DOM.PseudoType.Highlight || pseudoType === Protocol.DOM.PseudoType.Selection ||
325
318
  pseudoType === Protocol.DOM.PseudoType.TargetText || pseudoType === Protocol.DOM.PseudoType.GrammarError ||
326
319
  pseudoType === Protocol.DOM.PseudoType.SpellingError);
327
320
  }
@@ -652,7 +652,7 @@ export class DebuggerModel extends SDKModel<EventTypes> {
652
652
  this.evaluateOnCallFrameCallback = callback;
653
653
  }
654
654
 
655
- setSynchronizeBreakpointsCallback(callback: (script: Script) => Promise<void>): void {
655
+ setSynchronizeBreakpointsCallback(callback: ((script: Script) => Promise<void>)|null): void {
656
656
  this.#synchronizeBreakpointsCallback = callback;
657
657
  }
658
658
 
@@ -1535,8 +1535,7 @@ export class InterceptedRequest {
1535
1535
  Promise<void> {
1536
1536
  this.#hasRespondedInternal = true;
1537
1537
  const body = encoded ? await contentBlob.text() : await blobToBase64(contentBlob);
1538
- void this.#fetchAgent.invoke_fulfillRequest(
1539
- {requestId: this.requestId, responseCode: this.responseStatusCode || 200, body, responseHeaders});
1538
+ void this.#fetchAgent.invoke_fulfillRequest({requestId: this.requestId, responseCode: 200, body, responseHeaders});
1540
1539
 
1541
1540
  async function blobToBase64(blob: Blob): Promise<string> {
1542
1541
  const reader = new FileReader();
@@ -273,38 +273,68 @@ export function registerCommands(inspectorBackend) {
273
273
  'Audits.GenericIssueErrorType', {CrossOriginPortalPostMessageError: 'CrossOriginPortalPostMessageError'});
274
274
  inspectorBackend.registerEnum('Audits.DeprecationIssueType', {
275
275
  AuthorizationCoveredByWildcard: 'AuthorizationCoveredByWildcard',
276
+ BatteryStatusInsecureOrigin: 'BatteryStatusInsecureOrigin',
277
+ CanRequestURLHTTPContainingNewline: 'CanRequestURLHTTPContainingNewline',
278
+ ChromeLoadTimesConnectionInfo: 'ChromeLoadTimesConnectionInfo',
279
+ ChromeLoadTimesFirstPaintAfterLoadTime: 'ChromeLoadTimesFirstPaintAfterLoadTime',
280
+ ChromeLoadTimesWasAlternateProtocolAvailable: 'ChromeLoadTimesWasAlternateProtocolAvailable',
276
281
  CookieWithTruncatingChar: 'CookieWithTruncatingChar',
277
282
  CrossOriginAccessBasedOnDocumentDomain: 'CrossOriginAccessBasedOnDocumentDomain',
278
283
  CrossOriginWindowAlert: 'CrossOriginWindowAlert',
279
284
  CrossOriginWindowConfirm: 'CrossOriginWindowConfirm',
285
+ CSSSelectorInternalMediaControlsOverlayCastButton: 'CSSSelectorInternalMediaControlsOverlayCastButton',
286
+ CustomCursorIntersectsViewport: 'CustomCursorIntersectsViewport',
280
287
  DeprecationExample: 'DeprecationExample',
281
288
  DocumentDomainSettingWithoutOriginAgentClusterHeader: 'DocumentDomainSettingWithoutOriginAgentClusterHeader',
289
+ EventPath: 'EventPath',
282
290
  GeolocationInsecureOrigin: 'GeolocationInsecureOrigin',
283
291
  GeolocationInsecureOriginDeprecatedNotRemoved: 'GeolocationInsecureOriginDeprecatedNotRemoved',
284
292
  GetUserMediaInsecureOrigin: 'GetUserMediaInsecureOrigin',
293
+ HostCandidateAttributeGetter: 'HostCandidateAttributeGetter',
294
+ InsecurePrivateNetworkSubresourceRequest: 'InsecurePrivateNetworkSubresourceRequest',
285
295
  LegacyConstraintGoogCpuOveruseDetection: 'LegacyConstraintGoogCpuOveruseDetection',
286
296
  LegacyConstraintGoogIPv6: 'LegacyConstraintGoogIPv6',
287
297
  LegacyConstraintGoogScreencastMinBitrate: 'LegacyConstraintGoogScreencastMinBitrate',
288
298
  LegacyConstraintGoogSuspendBelowMinBitrate: 'LegacyConstraintGoogSuspendBelowMinBitrate',
289
299
  LocalCSSFileExtensionRejected: 'LocalCSSFileExtensionRejected',
300
+ MediaElementAudioSourceNode: 'MediaElementAudioSourceNode',
301
+ MediaSourceAbortRemove: 'MediaSourceAbortRemove',
302
+ MediaSourceDurationTruncatingBuffered: 'MediaSourceDurationTruncatingBuffered',
303
+ NoSysexWebMIDIWithoutPermission: 'NoSysexWebMIDIWithoutPermission',
290
304
  NotificationInsecureOrigin: 'NotificationInsecureOrigin',
305
+ NotificationPermissionRequestedIframe: 'NotificationPermissionRequestedIframe',
291
306
  ObsoleteWebRtcCipherSuite: 'ObsoleteWebRtcCipherSuite',
307
+ PaymentRequestBasicCard: 'PaymentRequestBasicCard',
308
+ PaymentRequestShowWithoutGesture: 'PaymentRequestShowWithoutGesture',
292
309
  PictureSourceSrc: 'PictureSourceSrc',
293
310
  PrefixedCancelAnimationFrame: 'PrefixedCancelAnimationFrame',
294
311
  PrefixedRequestAnimationFrame: 'PrefixedRequestAnimationFrame',
312
+ PrefixedStorageInfo: 'PrefixedStorageInfo',
313
+ PrefixedVideoDisplayingFullscreen: 'PrefixedVideoDisplayingFullscreen',
314
+ PrefixedVideoEnterFullscreen: 'PrefixedVideoEnterFullscreen',
315
+ PrefixedVideoEnterFullScreen: 'PrefixedVideoEnterFullScreen',
316
+ PrefixedVideoExitFullscreen: 'PrefixedVideoExitFullscreen',
317
+ PrefixedVideoExitFullScreen: 'PrefixedVideoExitFullScreen',
318
+ PrefixedVideoSupportsFullscreen: 'PrefixedVideoSupportsFullscreen',
319
+ RangeExpand: 'RangeExpand',
320
+ RequestedSubresourceWithEmbeddedCredentials: 'RequestedSubresourceWithEmbeddedCredentials',
295
321
  RTCConstraintEnableDtlsSrtpFalse: 'RTCConstraintEnableDtlsSrtpFalse',
296
322
  RTCConstraintEnableDtlsSrtpTrue: 'RTCConstraintEnableDtlsSrtpTrue',
297
323
  RTCPeerConnectionComplexPlanBSdpUsingDefaultSdpSemantics:
298
324
  'RTCPeerConnectionComplexPlanBSdpUsingDefaultSdpSemantics',
299
325
  RTCPeerConnectionLegacyCreateWithMediaConstraints: 'RTCPeerConnectionLegacyCreateWithMediaConstraints',
326
+ RTCPeerConnectionSdpSemanticsPlanB: 'RTCPeerConnectionSdpSemanticsPlanB',
327
+ RtcpMuxPolicyNegotiate: 'RtcpMuxPolicyNegotiate',
300
328
  RTPDataChannel: 'RTPDataChannel',
329
+ SelectionAddRangeIntersect: 'SelectionAddRangeIntersect',
301
330
  SharedArrayBufferConstructedWithoutIsolation: 'SharedArrayBufferConstructedWithoutIsolation',
302
- Untranslated: 'Untranslated',
331
+ TextToSpeech_DisallowedByAutoplay: 'TextToSpeech_DisallowedByAutoplay',
303
332
  V8SharedArrayBufferConstructedInExtensionWithoutIsolation:
304
333
  'V8SharedArrayBufferConstructedInExtensionWithoutIsolation',
305
334
  WebCodecsVideoFrameDefaultTimestamp: 'WebCodecsVideoFrameDefaultTimestamp',
306
335
  XHRJSONEncodingDetection: 'XHRJSONEncodingDetection',
307
- XMLHttpRequestSynchronousInNonWorkerOutsideBeforeUnload: 'XMLHttpRequestSynchronousInNonWorkerOutsideBeforeUnload'
336
+ XMLHttpRequestSynchronousInNonWorkerOutsideBeforeUnload: 'XMLHttpRequestSynchronousInNonWorkerOutsideBeforeUnload',
337
+ XRSupportsSession: 'XRSupportsSession'
308
338
  });
309
339
  inspectorBackend.registerEnum(
310
340
  'Audits.ClientHintIssueReason',
@@ -2103,6 +2133,7 @@ export function registerCommands(inspectorBackend) {
2103
2133
  InterestCohort: 'interest-cohort',
2104
2134
  JoinAdInterestGroup: 'join-ad-interest-group',
2105
2135
  KeyboardMap: 'keyboard-map',
2136
+ LocalFonts: 'local-fonts',
2106
2137
  Magnetometer: 'magnetometer',
2107
2138
  Microphone: 'microphone',
2108
2139
  Midi: 'midi',
@@ -2450,7 +2481,6 @@ export function registerCommands(inspectorBackend) {
2450
2481
  {'name': 'marginLeft', 'type': 'number', 'optional': true},
2451
2482
  {'name': 'marginRight', 'type': 'number', 'optional': true},
2452
2483
  {'name': 'pageRanges', 'type': 'string', 'optional': true},
2453
- {'name': 'ignoreInvalidPageRanges', 'type': 'boolean', 'optional': true},
2454
2484
  {'name': 'headerTemplate', 'type': 'string', 'optional': true},
2455
2485
  {'name': 'footerTemplate', 'type': 'string', 'optional': true},
2456
2486
  {'name': 'preferCSSPageSize', 'type': 'boolean', 'optional': true},
@@ -1020,62 +1020,77 @@ export namespace Audits {
1020
1020
 
1021
1021
  export const enum DeprecationIssueType {
1022
1022
  AuthorizationCoveredByWildcard = 'AuthorizationCoveredByWildcard',
1023
+ BatteryStatusInsecureOrigin = 'BatteryStatusInsecureOrigin',
1024
+ CanRequestURLHTTPContainingNewline = 'CanRequestURLHTTPContainingNewline',
1025
+ ChromeLoadTimesConnectionInfo = 'ChromeLoadTimesConnectionInfo',
1026
+ ChromeLoadTimesFirstPaintAfterLoadTime = 'ChromeLoadTimesFirstPaintAfterLoadTime',
1027
+ ChromeLoadTimesWasAlternateProtocolAvailable = 'ChromeLoadTimesWasAlternateProtocolAvailable',
1023
1028
  CookieWithTruncatingChar = 'CookieWithTruncatingChar',
1024
1029
  CrossOriginAccessBasedOnDocumentDomain = 'CrossOriginAccessBasedOnDocumentDomain',
1025
1030
  CrossOriginWindowAlert = 'CrossOriginWindowAlert',
1026
1031
  CrossOriginWindowConfirm = 'CrossOriginWindowConfirm',
1032
+ CSSSelectorInternalMediaControlsOverlayCastButton = 'CSSSelectorInternalMediaControlsOverlayCastButton',
1033
+ CustomCursorIntersectsViewport = 'CustomCursorIntersectsViewport',
1027
1034
  DeprecationExample = 'DeprecationExample',
1028
1035
  DocumentDomainSettingWithoutOriginAgentClusterHeader = 'DocumentDomainSettingWithoutOriginAgentClusterHeader',
1036
+ EventPath = 'EventPath',
1029
1037
  GeolocationInsecureOrigin = 'GeolocationInsecureOrigin',
1030
1038
  GeolocationInsecureOriginDeprecatedNotRemoved = 'GeolocationInsecureOriginDeprecatedNotRemoved',
1031
1039
  GetUserMediaInsecureOrigin = 'GetUserMediaInsecureOrigin',
1040
+ HostCandidateAttributeGetter = 'HostCandidateAttributeGetter',
1041
+ InsecurePrivateNetworkSubresourceRequest = 'InsecurePrivateNetworkSubresourceRequest',
1032
1042
  LegacyConstraintGoogCpuOveruseDetection = 'LegacyConstraintGoogCpuOveruseDetection',
1033
1043
  LegacyConstraintGoogIPv6 = 'LegacyConstraintGoogIPv6',
1034
1044
  LegacyConstraintGoogScreencastMinBitrate = 'LegacyConstraintGoogScreencastMinBitrate',
1035
1045
  LegacyConstraintGoogSuspendBelowMinBitrate = 'LegacyConstraintGoogSuspendBelowMinBitrate',
1036
1046
  LocalCSSFileExtensionRejected = 'LocalCSSFileExtensionRejected',
1047
+ MediaElementAudioSourceNode = 'MediaElementAudioSourceNode',
1048
+ MediaSourceAbortRemove = 'MediaSourceAbortRemove',
1049
+ MediaSourceDurationTruncatingBuffered = 'MediaSourceDurationTruncatingBuffered',
1050
+ NoSysexWebMIDIWithoutPermission = 'NoSysexWebMIDIWithoutPermission',
1037
1051
  NotificationInsecureOrigin = 'NotificationInsecureOrigin',
1052
+ NotificationPermissionRequestedIframe = 'NotificationPermissionRequestedIframe',
1038
1053
  ObsoleteWebRtcCipherSuite = 'ObsoleteWebRtcCipherSuite',
1054
+ PaymentRequestBasicCard = 'PaymentRequestBasicCard',
1055
+ PaymentRequestShowWithoutGesture = 'PaymentRequestShowWithoutGesture',
1039
1056
  PictureSourceSrc = 'PictureSourceSrc',
1040
1057
  PrefixedCancelAnimationFrame = 'PrefixedCancelAnimationFrame',
1041
1058
  PrefixedRequestAnimationFrame = 'PrefixedRequestAnimationFrame',
1059
+ PrefixedStorageInfo = 'PrefixedStorageInfo',
1060
+ PrefixedVideoDisplayingFullscreen = 'PrefixedVideoDisplayingFullscreen',
1061
+ PrefixedVideoEnterFullscreen = 'PrefixedVideoEnterFullscreen',
1062
+ PrefixedVideoEnterFullScreen = 'PrefixedVideoEnterFullScreen',
1063
+ PrefixedVideoExitFullscreen = 'PrefixedVideoExitFullscreen',
1064
+ PrefixedVideoExitFullScreen = 'PrefixedVideoExitFullScreen',
1065
+ PrefixedVideoSupportsFullscreen = 'PrefixedVideoSupportsFullscreen',
1066
+ RangeExpand = 'RangeExpand',
1067
+ RequestedSubresourceWithEmbeddedCredentials = 'RequestedSubresourceWithEmbeddedCredentials',
1042
1068
  RTCConstraintEnableDtlsSrtpFalse = 'RTCConstraintEnableDtlsSrtpFalse',
1043
1069
  RTCConstraintEnableDtlsSrtpTrue = 'RTCConstraintEnableDtlsSrtpTrue',
1044
1070
  RTCPeerConnectionComplexPlanBSdpUsingDefaultSdpSemantics =
1045
1071
  'RTCPeerConnectionComplexPlanBSdpUsingDefaultSdpSemantics',
1046
1072
  RTCPeerConnectionLegacyCreateWithMediaConstraints = 'RTCPeerConnectionLegacyCreateWithMediaConstraints',
1073
+ RTCPeerConnectionSdpSemanticsPlanB = 'RTCPeerConnectionSdpSemanticsPlanB',
1074
+ RtcpMuxPolicyNegotiate = 'RtcpMuxPolicyNegotiate',
1047
1075
  RTPDataChannel = 'RTPDataChannel',
1076
+ SelectionAddRangeIntersect = 'SelectionAddRangeIntersect',
1048
1077
  SharedArrayBufferConstructedWithoutIsolation = 'SharedArrayBufferConstructedWithoutIsolation',
1049
- Untranslated = 'Untranslated',
1078
+ TextToSpeech_DisallowedByAutoplay = 'TextToSpeech_DisallowedByAutoplay',
1050
1079
  V8SharedArrayBufferConstructedInExtensionWithoutIsolation =
1051
1080
  'V8SharedArrayBufferConstructedInExtensionWithoutIsolation',
1052
1081
  WebCodecsVideoFrameDefaultTimestamp = 'WebCodecsVideoFrameDefaultTimestamp',
1053
1082
  XHRJSONEncodingDetection = 'XHRJSONEncodingDetection',
1054
1083
  XMLHttpRequestSynchronousInNonWorkerOutsideBeforeUnload = 'XMLHttpRequestSynchronousInNonWorkerOutsideBeforeUnload',
1084
+ XRSupportsSession = 'XRSupportsSession',
1055
1085
  }
1056
1086
 
1057
1087
  /**
1058
1088
  * This issue tracks information needed to print a deprecation message.
1059
- * The formatting is inherited from the old console.log version, see more at:
1060
- * https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/frame/deprecation.cc
1061
- * TODO(crbug.com/1264960): Re-work format to add i18n support per:
1062
- * https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/public/devtools_protocol/README.md
1089
+ * https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/frame/third_party/blink/renderer/core/frame/deprecation/README.md
1063
1090
  */
1064
1091
  export interface DeprecationIssueDetails {
1065
1092
  affectedFrame?: AffectedFrame;
1066
1093
  sourceCodeLocation: SourceCodeLocation;
1067
- /**
1068
- * The content of an untranslated deprecation issue,
1069
- * e.g. "window.inefficientLegacyStorageMethod will be removed in M97,
1070
- * around January 2022. Please use Web Storage or Indexed Database
1071
- * instead. This standard was abandoned in January, 1970. See
1072
- * https://www.chromestatus.com/feature/5684870116278272 for more details."
1073
- */
1074
- message?: string;
1075
- /**
1076
- * The id of an untranslated deprecation issue e.g. PrefixedStorageInfo.
1077
- */
1078
- deprecationType?: string;
1079
1094
  type: DeprecationIssueType;
1080
1095
  }
1081
1096
 
@@ -5162,6 +5177,8 @@ export namespace Emulation {
5162
5177
  architecture: string;
5163
5178
  model: string;
5164
5179
  mobile: boolean;
5180
+ bitness?: string;
5181
+ wow64?: boolean;
5165
5182
  }
5166
5183
 
5167
5184
  /**
@@ -10200,6 +10217,7 @@ export namespace Page {
10200
10217
  InterestCohort = 'interest-cohort',
10201
10218
  JoinAdInterestGroup = 'join-ad-interest-group',
10202
10219
  KeyboardMap = 'keyboard-map',
10220
+ LocalFonts = 'local-fonts',
10203
10221
  Magnetometer = 'magnetometer',
10204
10222
  Microphone = 'microphone',
10205
10223
  Midi = 'midi',
@@ -10671,6 +10689,10 @@ export namespace Page {
10671
10689
  * The fantasy font-family.
10672
10690
  */
10673
10691
  fantasy?: string;
10692
+ /**
10693
+ * The math font-family.
10694
+ */
10695
+ math?: string;
10674
10696
  }
10675
10697
 
10676
10698
  /**
@@ -11300,15 +11322,16 @@ export namespace Page {
11300
11322
  */
11301
11323
  marginRight?: number;
11302
11324
  /**
11303
- * Paper ranges to print, e.g., '1-5, 8, 11-13'. Defaults to the empty string, which means
11304
- * print all pages.
11325
+ * Paper ranges to print, one based, e.g., '1-5, 8, 11-13'. Pages are
11326
+ * printed in the document order, not in the order specified, and no
11327
+ * more than once.
11328
+ * Defaults to empty string, which implies the entire document is printed.
11329
+ * The page numbers are quietly capped to actual page count of the
11330
+ * document, and ranges beyond the end of the document are ignored.
11331
+ * If this results in no pages to print, an error is reported.
11332
+ * It is an error to specify a range with start greater than end.
11305
11333
  */
11306
11334
  pageRanges?: string;
11307
- /**
11308
- * Whether to silently ignore invalid but successfully parsed page ranges, such as '3-2'.
11309
- * Defaults to false.
11310
- */
11311
- ignoreInvalidPageRanges?: boolean;
11312
11335
  /**
11313
11336
  * HTML template for the print header. Should be valid HTML markup with following
11314
11337
  * classes used to inject printing values into them:
@@ -100,11 +100,12 @@ export class BreakpointManager extends Common.ObjectWrapper.ObjectWrapper<EventT
100
100
 
101
101
  modelAdded(debuggerModel: SDK.DebuggerModel.DebuggerModel): void {
102
102
  if (Root.Runtime.experiments.isEnabled(Root.Runtime.ExperimentName.INSTRUMENTATION_BREAKPOINTS)) {
103
- debuggerModel.setSynchronizeBreakpointsCallback(this.#restoreBreakpointsForScript.bind(this));
103
+ debuggerModel.setSynchronizeBreakpointsCallback(this.restoreBreakpointsForScript.bind(this));
104
104
  }
105
105
  }
106
106
 
107
- modelRemoved(): void {
107
+ modelRemoved(debuggerModel: SDK.DebuggerModel.DebuggerModel): void {
108
+ debuggerModel.setSynchronizeBreakpointsCallback(null);
108
109
  }
109
110
 
110
111
  async copyBreakpoints(fromURL: Platform.DevToolsPath.UrlString, toSourceCode: Workspace.UISourceCode.UISourceCode):
@@ -117,7 +118,7 @@ export class BreakpointManager extends Common.ObjectWrapper.ObjectWrapper<EventT
117
118
 
118
119
  // This method explicitly awaits the source map (if necessary) and the uiSourceCodes
119
120
  // required to set all breakpoints that are related to this script.
120
- async #restoreBreakpointsForScript(script: SDK.Script.Script): Promise<void> {
121
+ async restoreBreakpointsForScript(script: SDK.Script.Script): Promise<void> {
121
122
  if (!Root.Runtime.experiments.isEnabled(Root.Runtime.ExperimentName.INSTRUMENTATION_BREAKPOINTS)) {
122
123
  return;
123
124
  }
@@ -416,6 +417,10 @@ export class Breakpoint implements SDK.TargetManager.SDKModelObserver<SDK.Debugg
416
417
  modelBreakpoint.removeEventListeners();
417
418
  }
418
419
 
420
+ modelBreakpoint(debuggerModel: SDK.DebuggerModel.DebuggerModel): ModelBreakpoint|undefined {
421
+ return this.#modelBreakpoints.get(debuggerModel);
422
+ }
423
+
419
424
  addUISourceCode(uiSourceCode: Workspace.UISourceCode.UISourceCode): void {
420
425
  if (!this.uiSourceCodes.has(uiSourceCode)) {
421
426
  this.uiSourceCodes.add(uiSourceCode);
@@ -626,6 +631,10 @@ export class ModelBreakpoint {
626
631
  }
627
632
  }
628
633
 
634
+ get currentState(): Breakpoint.State|null {
635
+ return this.#currentState;
636
+ }
637
+
629
638
  resetLocations(): void {
630
639
  for (const uiLocation of this.#uiLocations.values()) {
631
640
  this.#breakpoint.uiLocationRemoved(uiLocation);