chrome-devtools-frontend 1.0.981004 → 1.0.981537

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.
@@ -10991,6 +10991,9 @@
10991
10991
  "panels/timeline/TimelineUIUtils.ts | pinchUpdate": {
10992
10992
  "message": "Pinch Update"
10993
10993
  },
10994
+ "panels/timeline/TimelineUIUtils.ts | prePaint": {
10995
+ "message": "Pre-Paint"
10996
+ },
10994
10997
  "panels/timeline/TimelineUIUtils.ts | preview": {
10995
10998
  "message": "Preview"
10996
10999
  },
@@ -10991,6 +10991,9 @@
10991
10991
  "panels/timeline/TimelineUIUtils.ts | pinchUpdate": {
10992
10992
  "message": "P̂ín̂ćĥ Úp̂d́ât́ê"
10993
10993
  },
10994
+ "panels/timeline/TimelineUIUtils.ts | prePaint": {
10995
+ "message": "P̂ŕê-Ṕâín̂t́"
10996
+ },
10994
10997
  "panels/timeline/TimelineUIUtils.ts | preview": {
10995
10998
  "message": "P̂ŕêv́îéŵ"
10996
10999
  },
@@ -289,6 +289,8 @@ export function registerCommands(inspectorBackend) {
289
289
  ClientMetadataHttpNotFound: 'ClientMetadataHttpNotFound',
290
290
  ClientMetadataNoResponse: 'ClientMetadataNoResponse',
291
291
  ClientMetadataInvalidResponse: 'ClientMetadataInvalidResponse',
292
+ ClientMetadataMissingPrivacyPolicyUrl: 'ClientMetadataMissingPrivacyPolicyUrl',
293
+ DisabledInSettings: 'DisabledInSettings',
292
294
  ErrorFetchingSignin: 'ErrorFetchingSignin',
293
295
  InvalidSigninResponse: 'InvalidSigninResponse',
294
296
  AccountsHttpNotFound: 'AccountsHttpNotFound',
@@ -511,8 +513,10 @@ export function registerCommands(inspectorBackend) {
511
513
  'CSS.getInlineStylesForNode', [{'name': 'nodeId', 'type': 'number', 'optional': false}],
512
514
  ['inlineStyle', 'attributesStyle']);
513
515
  inspectorBackend.registerCommand(
514
- 'CSS.getMatchedStylesForNode', [{'name': 'nodeId', 'type': 'number', 'optional': false}],
515
- ['inlineStyle', 'attributesStyle', 'matchedCSSRules', 'pseudoElements', 'inherited', 'cssKeyframesRules']);
516
+ 'CSS.getMatchedStylesForNode', [{'name': 'nodeId', 'type': 'number', 'optional': false}], [
517
+ 'inlineStyle', 'attributesStyle', 'matchedCSSRules', 'pseudoElements', 'inherited', 'inheritedPseudoElements',
518
+ 'cssKeyframesRules'
519
+ ]);
516
520
  inspectorBackend.registerCommand('CSS.getMediaQueries', [], ['medias']);
517
521
  inspectorBackend.registerCommand(
518
522
  'CSS.getPlatformFontsForNode', [{'name': 'nodeId', 'type': 'number', 'optional': false}], ['fonts']);
@@ -1069,6 +1069,8 @@ export namespace Audits {
1069
1069
  ClientMetadataHttpNotFound = 'ClientMetadataHttpNotFound',
1070
1070
  ClientMetadataNoResponse = 'ClientMetadataNoResponse',
1071
1071
  ClientMetadataInvalidResponse = 'ClientMetadataInvalidResponse',
1072
+ ClientMetadataMissingPrivacyPolicyUrl = 'ClientMetadataMissingPrivacyPolicyUrl',
1073
+ DisabledInSettings = 'DisabledInSettings',
1072
1074
  ErrorFetchingSignin = 'ErrorFetchingSignin',
1073
1075
  InvalidSigninResponse = 'InvalidSigninResponse',
1074
1076
  AccountsHttpNotFound = 'AccountsHttpNotFound',
@@ -1763,6 +1765,16 @@ export namespace CSS {
1763
1765
  matchedCSSRules: RuleMatch[];
1764
1766
  }
1765
1767
 
1768
+ /**
1769
+ * Inherited pseudo element matches from pseudos of an ancestor node.
1770
+ */
1771
+ export interface InheritedPseudoElementMatches {
1772
+ /**
1773
+ * Matches of pseudo styles from the pseudos of an ancestor node.
1774
+ */
1775
+ pseudoElements: PseudoElementMatches[];
1776
+ }
1777
+
1766
1778
  /**
1767
1779
  * Match data for a CSS rule.
1768
1780
  */
@@ -2504,6 +2516,10 @@ export namespace CSS {
2504
2516
  * A chain of inherited styles (from the immediate node parent up to the DOM tree root).
2505
2517
  */
2506
2518
  inherited?: InheritedStyleEntry[];
2519
+ /**
2520
+ * A chain of inherited pseudo element styles (from the immediate node parent up to the DOM tree root).
2521
+ */
2522
+ inheritedPseudoElements?: InheritedPseudoElementMatches[];
2507
2523
  /**
2508
2524
  * A list of CSS keyframed animations matching this node.
2509
2525
  */
@@ -1462,6 +1462,7 @@ export enum RecordType {
1462
1462
  PaintSetup = 'PaintSetup',
1463
1463
  Paint = 'Paint',
1464
1464
  PaintImage = 'PaintImage',
1465
+ PrePaint = 'PrePaint',
1465
1466
  Rasterize = 'Rasterize',
1466
1467
  RasterTask = 'RasterTask',
1467
1468
  ScrollLayer = 'ScrollLayer',
@@ -196,3 +196,26 @@ export const format = (fmt: string, args: SDK.RemoteObject.RemoteObject[]): {
196
196
  addStringToken(fmt);
197
197
  return {tokens, args: args.slice(argIndex)};
198
198
  };
199
+
200
+ export const updateStyle = (currentStyle: Map<string, {value: string, priority: string}>, styleToAdd: string): void => {
201
+ const ALLOWED_PROPERTY_PREFIXES = ['background', 'border', 'color', 'font', 'line', 'margin', 'padding', 'text'];
202
+ const BLOCKED_URL_SCHEMES = ['chrome', 'resource', 'about', 'app', 'http', 'https', 'ftp', 'file'];
203
+
204
+ currentStyle.clear();
205
+ const buffer = document.createElement('span');
206
+ buffer.setAttribute('style', styleToAdd);
207
+ for (const property of buffer.style) {
208
+ if (!ALLOWED_PROPERTY_PREFIXES.some(
209
+ prefix => property.startsWith(prefix) || property.startsWith(`-webkit-${prefix}`))) {
210
+ continue;
211
+ }
212
+ const value = buffer.style.getPropertyValue(property);
213
+ if (BLOCKED_URL_SCHEMES.some(scheme => value.includes(scheme + ':'))) {
214
+ continue;
215
+ }
216
+ currentStyle.set(property, {
217
+ value,
218
+ priority: buffer.style.getPropertyPriority(property),
219
+ });
220
+ }
221
+ };
@@ -53,7 +53,7 @@ import * as UI from '../../ui/legacy/legacy.js';
53
53
  import objectValueStyles from '../../ui/legacy/components/object_ui/objectValue.css.js';
54
54
  import type {Chrome} from '../../../extension-api/ExtensionAPI.js'; // eslint-disable-line rulesdir/es_modules_import
55
55
 
56
- import {format} from './ConsoleFormat.js';
56
+ import {format, updateStyle} from './ConsoleFormat.js';
57
57
  import type {ConsoleViewportElement} from './ConsoleViewport.js';
58
58
  import consoleViewStyles from './consoleView.css.js';
59
59
  import {augmentErrorStackWithScriptIds, parseSourcePositionsFromErrorStack} from './ErrorStackParser.js';
@@ -925,26 +925,10 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
925
925
  }
926
926
  break;
927
927
  }
928
- case 'style': {
928
+ case 'style':
929
929
  // Make sure that allowed properties do not interfere with link visibility.
930
- const ALLOWED_PROPERTY_PREFIXES =
931
- ['background', 'border', 'color', 'font', 'line', 'margin', 'padding', 'text'];
932
-
933
- currentStyle.clear();
934
- const buffer = document.createElement('span');
935
- buffer.setAttribute('style', token.value);
936
- for (const property of buffer.style) {
937
- if (!ALLOWED_PROPERTY_PREFIXES.some(
938
- prefix => property.startsWith(prefix) || property.startsWith(`-webkit-${prefix}`))) {
939
- continue;
940
- }
941
- currentStyle.set(property, {
942
- value: buffer.style.getPropertyValue(property),
943
- priority: buffer.style.getPropertyPriority(property),
944
- });
945
- }
930
+ updateStyle(currentStyle, token.value);
946
931
  break;
947
- }
948
932
  }
949
933
  }
950
934
  return args;
@@ -2,9 +2,10 @@
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 Common from '../../core/common/common.js';
5
+ import type * as Common from '../../core/common/common.js';
6
6
  import * as Host from '../../core/host/host.js';
7
7
  import * as UI from '../../ui/legacy/legacy.js';
8
+ import * as ThemeSupport from '../../ui/legacy/theme_support/theme_support.js';
8
9
 
9
10
  import {DeviceModeWrapper} from './DeviceModeWrapper.js';
10
11
  import type {Bounds} from './InspectedPagePlaceholder.js';
@@ -77,7 +78,10 @@ export class AdvancedApp implements Common.App.App {
77
78
  }
78
79
 
79
80
  deviceModeEmulationFrameLoaded(toolboxDocument: Document): void {
80
- Common.Settings.Settings.instance().createSetting('uiTheme', 'default');
81
+ ThemeSupport.ThemeSupport.instance().applyTheme(toolboxDocument);
82
+ ThemeSupport.ThemeSupport.instance().addEventListener(ThemeSupport.ThemeChangeEvent.eventName, () => {
83
+ ThemeSupport.ThemeSupport.instance().applyTheme(toolboxDocument);
84
+ });
81
85
  UI.UIUtils.initializeUIUtils(toolboxDocument);
82
86
  UI.UIUtils.installComponentRootStyles((toolboxDocument.body as Element));
83
87
  UI.ContextMenu.ContextMenu.installHandler(toolboxDocument);
@@ -132,6 +132,12 @@ const UIStrings = {
132
132
  */
133
133
  paintImage: 'Paint Image',
134
134
  /**
135
+ *@description Noun for an event in the Performance panel. Pre-paint is a
136
+ *step before the 'Paint' event. A paint event is when the browser records the
137
+ *instructions for drawing the page. This step is the setup beforehand.
138
+ */
139
+ prePaint: 'Pre-Paint',
140
+ /**
135
141
  *@description Text in Timeline UIUtils of the Performance panel
136
142
  */
137
143
  updateLayer: 'Update Layer',
@@ -1283,6 +1289,7 @@ export class TimelineUIUtils {
1283
1289
  eventStyles[type.UpdateLayer] = new TimelineRecordStyle(i18nString(UIStrings.updateLayer), painting, true);
1284
1290
  eventStyles[type.UpdateLayerTree] = new TimelineRecordStyle(i18nString(UIStrings.updateLayerTree), rendering);
1285
1291
  eventStyles[type.Paint] = new TimelineRecordStyle(i18nString(UIStrings.paint), painting);
1292
+ eventStyles[type.PrePaint] = new TimelineRecordStyle(i18nString(UIStrings.prePaint), rendering);
1286
1293
  eventStyles[type.RasterTask] = new TimelineRecordStyle(i18nString(UIStrings.rasterizePaint), painting);
1287
1294
  eventStyles[type.ScrollLayer] = new TimelineRecordStyle(i18nString(UIStrings.scroll), rendering);
1288
1295
  eventStyles[type.CompositeLayers] = new TimelineRecordStyle(i18nString(UIStrings.compositeLayers), painting);