chrome-devtools-frontend 1.0.1014346 → 1.0.1015658

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 (119) hide show
  1. package/.eslintignore +1 -0
  2. package/config/gni/devtools_grd_files.gni +4 -2
  3. package/front_end/core/common/JavaScriptMetaData.ts +20 -0
  4. package/front_end/core/i18n/locales/af.json +195 -93
  5. package/front_end/core/i18n/locales/am.json +191 -89
  6. package/front_end/core/i18n/locales/ar.json +193 -91
  7. package/front_end/core/i18n/locales/as.json +192 -90
  8. package/front_end/core/i18n/locales/az.json +191 -89
  9. package/front_end/core/i18n/locales/be.json +191 -89
  10. package/front_end/core/i18n/locales/bg.json +190 -88
  11. package/front_end/core/i18n/locales/bn.json +191 -89
  12. package/front_end/core/i18n/locales/bs.json +193 -91
  13. package/front_end/core/i18n/locales/ca.json +189 -87
  14. package/front_end/core/i18n/locales/cs.json +191 -89
  15. package/front_end/core/i18n/locales/cy.json +191 -89
  16. package/front_end/core/i18n/locales/da.json +191 -89
  17. package/front_end/core/i18n/locales/de.json +193 -91
  18. package/front_end/core/i18n/locales/el.json +174 -72
  19. package/front_end/core/i18n/locales/en-GB.json +132 -30
  20. package/front_end/core/i18n/locales/en-US.json +3 -3
  21. package/front_end/core/i18n/locales/en-XL.json +3 -3
  22. package/front_end/core/i18n/locales/es-419.json +192 -90
  23. package/front_end/core/i18n/locales/es.json +200 -98
  24. package/front_end/core/i18n/locales/et.json +190 -88
  25. package/front_end/core/i18n/locales/eu.json +197 -95
  26. package/front_end/core/i18n/locales/fa.json +192 -90
  27. package/front_end/core/i18n/locales/fi.json +192 -90
  28. package/front_end/core/i18n/locales/fil.json +190 -88
  29. package/front_end/core/i18n/locales/fr-CA.json +191 -89
  30. package/front_end/core/i18n/locales/fr.json +192 -90
  31. package/front_end/core/i18n/locales/gl.json +173 -71
  32. package/front_end/core/i18n/locales/gu.json +192 -90
  33. package/front_end/core/i18n/locales/he.json +191 -89
  34. package/front_end/core/i18n/locales/hi.json +172 -70
  35. package/front_end/core/i18n/locales/hr.json +180 -78
  36. package/front_end/core/i18n/locales/hu.json +191 -89
  37. package/front_end/core/i18n/locales/hy.json +192 -90
  38. package/front_end/core/i18n/locales/id.json +192 -90
  39. package/front_end/core/i18n/locales/is.json +176 -74
  40. package/front_end/core/i18n/locales/it.json +192 -90
  41. package/front_end/core/i18n/locales/ja.json +190 -88
  42. package/front_end/core/i18n/locales/ka.json +190 -88
  43. package/front_end/core/i18n/locales/kk.json +198 -96
  44. package/front_end/core/i18n/locales/km.json +195 -93
  45. package/front_end/core/i18n/locales/kn.json +193 -91
  46. package/front_end/core/i18n/locales/ko.json +190 -88
  47. package/front_end/core/i18n/locales/ky.json +193 -91
  48. package/front_end/core/i18n/locales/lo.json +192 -90
  49. package/front_end/core/i18n/locales/lt.json +193 -91
  50. package/front_end/core/i18n/locales/lv.json +175 -73
  51. package/front_end/core/i18n/locales/mk.json +193 -91
  52. package/front_end/core/i18n/locales/ml.json +193 -91
  53. package/front_end/core/i18n/locales/mn.json +190 -88
  54. package/front_end/core/i18n/locales/mr.json +191 -89
  55. package/front_end/core/i18n/locales/ms.json +190 -88
  56. package/front_end/core/i18n/locales/my.json +191 -89
  57. package/front_end/core/i18n/locales/ne.json +172 -70
  58. package/front_end/core/i18n/locales/nl.json +191 -89
  59. package/front_end/core/i18n/locales/no.json +191 -89
  60. package/front_end/core/i18n/locales/or.json +196 -94
  61. package/front_end/core/i18n/locales/pa.json +191 -89
  62. package/front_end/core/i18n/locales/pl.json +191 -89
  63. package/front_end/core/i18n/locales/pt-PT.json +199 -97
  64. package/front_end/core/i18n/locales/pt.json +191 -89
  65. package/front_end/core/i18n/locales/ro.json +193 -91
  66. package/front_end/core/i18n/locales/ru.json +193 -91
  67. package/front_end/core/i18n/locales/si.json +191 -89
  68. package/front_end/core/i18n/locales/sk.json +192 -90
  69. package/front_end/core/i18n/locales/sl.json +191 -89
  70. package/front_end/core/i18n/locales/sq.json +193 -91
  71. package/front_end/core/i18n/locales/sr-Latn.json +190 -88
  72. package/front_end/core/i18n/locales/sr.json +190 -88
  73. package/front_end/core/i18n/locales/sv.json +191 -89
  74. package/front_end/core/i18n/locales/sw.json +192 -90
  75. package/front_end/core/i18n/locales/ta.json +193 -91
  76. package/front_end/core/i18n/locales/te.json +134 -32
  77. package/front_end/core/i18n/locales/th.json +190 -88
  78. package/front_end/core/i18n/locales/tr.json +193 -91
  79. package/front_end/core/i18n/locales/uk.json +193 -91
  80. package/front_end/core/i18n/locales/ur.json +191 -89
  81. package/front_end/core/i18n/locales/uz.json +190 -88
  82. package/front_end/core/i18n/locales/vi.json +190 -88
  83. package/front_end/core/i18n/locales/zh-HK.json +192 -90
  84. package/front_end/core/i18n/locales/zh-TW.json +195 -93
  85. package/front_end/core/i18n/locales/zh.json +191 -89
  86. package/front_end/core/i18n/locales/zu.json +192 -90
  87. package/front_end/core/sdk/DOMModel.ts +9 -0
  88. package/front_end/core/sdk/DebuggerModel.ts +0 -28
  89. package/front_end/core/sdk/Script.ts +5 -14
  90. package/front_end/core/sdk/SourceMap.ts +88 -27
  91. package/front_end/generated/InspectorBackendCommands.js +7 -3
  92. package/front_end/generated/protocol-mapping.d.ts +16 -0
  93. package/front_end/generated/protocol-proxy-api.d.ts +18 -0
  94. package/front_end/generated/protocol.ts +31 -5
  95. package/front_end/models/bindings/ResourceScriptMapping.ts +1 -2
  96. package/front_end/models/emulation/EmulatedDevices.ts +0 -13
  97. package/front_end/models/javascript_metadata/DOMPinnedProperties.ts +247 -225
  98. package/front_end/models/javascript_metadata/JavaScriptMetadata.ts +3 -0
  99. package/front_end/models/javascript_metadata/NativeFunctions.js +4 -4
  100. package/front_end/models/javascript_metadata/javascript_metadata.ts +3 -0
  101. package/front_end/models/source_map_scopes/NamesResolver.ts +99 -23
  102. package/front_end/panels/elements/ElementsTreeElement.ts +7 -3
  103. package/front_end/panels/elements/components/ElementsBreadcrumbs.ts +3 -4
  104. package/front_end/panels/elements/components/LayoutPane.ts +3 -4
  105. package/front_end/panels/elements/components/QueryContainer.ts +3 -4
  106. package/front_end/panels/elements/components/components.ts +0 -2
  107. package/front_end/panels/lighthouse/lighthouseStartView.css +3 -1
  108. package/front_end/panels/sources/ScopeChainSidebarPane.ts +4 -42
  109. package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspectorController.ts +64 -8
  110. package/front_end/{panels/elements/components → ui/components/node_text}/NodeText.ts +2 -1
  111. package/front_end/{panels/elements/components → ui/components/node_text}/nodeText.css +0 -0
  112. package/front_end/ui/components/node_text/node_text.ts +9 -0
  113. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +8 -5
  114. package/front_end/ui/legacy/components/object_ui/objectValue.css +1 -4
  115. package/package.json +1 -1
  116. package/scripts/webidl-properties/config.js +305 -239
  117. package/scripts/webidl-properties/get-props.js +23 -12
  118. package/scripts/webidl-properties/index.js +14 -9
  119. package/scripts/webidl-properties/tests.js +58 -14
@@ -21,8 +21,8 @@ const names = Object.keys(SPECS);
21
21
  const specs = await Promise.all(names.map(name => files[name].parse().then(idls => ({name, idls}))));
22
22
 
23
23
  const output = addMetadata(getIDLProps(specs));
24
- const missing = getMissingTypes(output);
25
24
 
25
+ const missing = getMissingTypes(output);
26
26
  for (const type of missing) {
27
27
  console.warn('Found missing type:', type);
28
28
  }
@@ -32,6 +32,8 @@ const jsMetadataPath = path.join(frontendPath, 'front_end/models/javascript_meta
32
32
  const outPath = path.join(jsMetadataPath, 'DOMPinnedProperties.ts');
33
33
  const thisPath = path.relative(frontendPath, url.fileURLToPath(import.meta.url));
34
34
 
35
+ const stringify = object => JSON.stringify(object, null, 2);
36
+
35
37
  fs.writeFileSync(outPath, `
36
38
  // Copyright 2022 The Chromium Authors. All rights reserved.
37
39
  // Use of this source code is governed by a BSD-style license that can be
@@ -41,7 +43,7 @@ fs.writeFileSync(outPath, `
41
43
  /**
42
44
  * All the specs used when generating the DOM pinned properties dataset.
43
45
  */
44
- export const SPECS = ${JSON.stringify(SPECS)};
46
+ export const SPECS = ${stringify(SPECS)};
45
47
 
46
48
  export interface DOMPinnedWebIDLProp {
47
49
  // A flag specifying whether it's a "global" attribute.
@@ -49,6 +51,8 @@ export interface DOMPinnedWebIDLProp {
49
51
  // A bitfield of the specs in which the property is found.
50
52
  // If missing, it implies the default spec: "html".
51
53
  specs?: number;
54
+ // The "states" in which this property is "applicable".
55
+ rules?: Array<DOMPinnedWebIDLRule>;
52
56
  }
53
57
 
54
58
  export interface DOMPinnedWebIDLType {
@@ -62,12 +66,12 @@ export interface DOMPinnedWebIDLType {
62
66
  [PropName: string]: DOMPinnedWebIDLProp,
63
67
  };
64
68
  // The "states" in which only certain properties are "applicable".
65
- states?: {
66
- // A CSS selector such as "[type=checkbox]".
67
- [State: string]: {
68
- [PropName: string]: DOMPinnedWebIDLProp,
69
- },
70
- };
69
+ rules?: Array<DOMPinnedWebIDLRule>;
70
+ }
71
+
72
+ export interface DOMPinnedWebIDLRule {
73
+ when: string;
74
+ is: string;
71
75
  }
72
76
 
73
77
  export interface DOMPinnedPropertiesDataset {
@@ -81,5 +85,6 @@ export interface DOMPinnedPropertiesDataset {
81
85
  * This is an object with WebIDL type names as keys and their WebIDL properties
82
86
  * and inheritance/include chains as values.
83
87
  */
84
- export const DOMPinnedProperties: DOMPinnedPropertiesDataset = ${JSON.stringify(minimize(output))};
88
+ export const DOMPinnedProperties: DOMPinnedPropertiesDataset = ${stringify(minimize(output))};
89
+
85
90
  `);
@@ -39,7 +39,7 @@ describe('DOM pinned properties dataset generation', function() {
39
39
  global: true,
40
40
  specs: ['html'],
41
41
  });
42
- assert.strictEqual(type.states, undefined);
42
+ assert.strictEqual(type.rules, undefined);
43
43
  });
44
44
 
45
45
  it('generates valid data for HTMLInputElement', () => {
@@ -49,12 +49,34 @@ describe('DOM pinned properties dataset generation', function() {
49
49
  assert.deepEqual(type.props.checked, {
50
50
  global: false,
51
51
  specs: ['html'],
52
+ rules: [{when: 'type', is: 'checkbox'}, {when: 'type', is: 'radio'}],
52
53
  });
53
- assert.deepEqual(type.states['[type=checkbox]'], {
54
- checked: {global: false, specs: ['html']},
55
- required: {global: false, specs: ['html']},
56
- value: {global: false, specs: ['html']},
54
+ assert.deepEqual(type.props.required, {
55
+ global: false,
56
+ specs: ['html'],
57
+ rules: [
58
+ {when: 'type', is: 'text'}, {when: 'type', is: 'search'}, {when: 'type', is: 'url'}, {when: 'type', is: 'tel'},
59
+ {when: 'type', is: 'email'}, {when: 'type', is: 'password'}, {when: 'type', is: 'date'},
60
+ {when: 'type', is: 'month'}, {when: 'type', is: 'week'}, {when: 'type', is: 'time'},
61
+ {when: 'type', is: 'datetime-local'}, {when: 'type', is: 'number'}, {when: 'type', is: 'checkbox'},
62
+ {when: 'type', is: 'radio'}, {when: 'type', is: 'file'}
63
+ ]
64
+ });
65
+ assert.deepEqual(type.props.value, {
66
+ global: false,
67
+ specs: ['html'],
68
+ rules: type.rules,
57
69
  });
70
+ assert.deepEqual(type.rules, [
71
+ {when: 'type', is: 'hidden'}, {when: 'type', is: 'text'}, {when: 'type', is: 'search'},
72
+ {when: 'type', is: 'url'}, {when: 'type', is: 'tel'}, {when: 'type', is: 'email'},
73
+ {when: 'type', is: 'password'}, {when: 'type', is: 'date'}, {when: 'type', is: 'month'},
74
+ {when: 'type', is: 'week'}, {when: 'type', is: 'time'}, {when: 'type', is: 'datetime-local'},
75
+ {when: 'type', is: 'number'}, {when: 'type', is: 'range'}, {when: 'type', is: 'color'},
76
+ {when: 'type', is: 'checkbox'}, {when: 'type', is: 'radio'}, {when: 'type', is: 'file'},
77
+ {when: 'type', is: 'submit'}, {when: 'type', is: 'image'}, {when: 'type', is: 'reset'},
78
+ {when: 'type', is: 'button'},
79
+ ]);
58
80
  });
59
81
 
60
82
  it('generates valid data for MouseEvent', () => {
@@ -65,7 +87,7 @@ describe('DOM pinned properties dataset generation', function() {
65
87
  global: false,
66
88
  specs: ['uievents'],
67
89
  });
68
- assert.strictEqual(type.states, undefined);
90
+ assert.strictEqual(type.rules, undefined);
69
91
  });
70
92
 
71
93
  it('generates valid data for PointerEvent', () => {
@@ -76,7 +98,7 @@ describe('DOM pinned properties dataset generation', function() {
76
98
  global: false,
77
99
  specs: ['pointerevents'],
78
100
  });
79
- assert.strictEqual(type.states, undefined);
101
+ assert.strictEqual(type.rules, undefined);
80
102
  });
81
103
 
82
104
  it('generates an entry for DOMParser', () => {
@@ -84,7 +106,7 @@ describe('DOM pinned properties dataset generation', function() {
84
106
  assert.strictEqual(type.inheritance, null);
85
107
  assert.deepEqual(type.includes, []);
86
108
  assert.deepEqual(type.props, {});
87
- assert.strictEqual(type.states, undefined);
109
+ assert.strictEqual(type.rules, undefined);
88
110
  });
89
111
 
90
112
  it('minimizes the data for HTMLInputElement', () => {
@@ -92,12 +114,34 @@ describe('DOM pinned properties dataset generation', function() {
92
114
  const type = minimized.HTMLInputElement;
93
115
  assert.strictEqual(type.inheritance, 'HTMLElement');
94
116
  assert.strictEqual(type.includes, undefined);
95
- assert.deepEqual(type.props.checked, {});
96
- assert.deepEqual(type.states['[type=checkbox]'], {
97
- checked: {},
98
- required: {},
99
- value: {},
117
+ assert.deepEqual(type.props.checked, {
118
+ rules: [
119
+ {when: 'type', is: 'checkbox'},
120
+ {when: 'type', is: 'radio'},
121
+ ],
122
+ });
123
+ assert.deepEqual(type.props.required, {
124
+ rules: [
125
+ {when: 'type', is: 'text'}, {when: 'type', is: 'search'}, {when: 'type', is: 'url'}, {when: 'type', is: 'tel'},
126
+ {when: 'type', is: 'email'}, {when: 'type', is: 'password'}, {when: 'type', is: 'date'},
127
+ {when: 'type', is: 'month'}, {when: 'type', is: 'week'}, {when: 'type', is: 'time'},
128
+ {when: 'type', is: 'datetime-local'}, {when: 'type', is: 'number'}, {when: 'type', is: 'checkbox'},
129
+ {when: 'type', is: 'radio'}, {when: 'type', is: 'file'}
130
+ ],
100
131
  });
132
+ assert.deepEqual(type.props.value, {
133
+ rules: type.rules,
134
+ });
135
+ assert.deepEqual(type.rules, [
136
+ {when: 'type', is: 'hidden'}, {when: 'type', is: 'text'}, {when: 'type', is: 'search'},
137
+ {when: 'type', is: 'url'}, {when: 'type', is: 'tel'}, {when: 'type', is: 'email'},
138
+ {when: 'type', is: 'password'}, {when: 'type', is: 'date'}, {when: 'type', is: 'month'},
139
+ {when: 'type', is: 'week'}, {when: 'type', is: 'time'}, {when: 'type', is: 'datetime-local'},
140
+ {when: 'type', is: 'number'}, {when: 'type', is: 'range'}, {when: 'type', is: 'color'},
141
+ {when: 'type', is: 'checkbox'}, {when: 'type', is: 'radio'}, {when: 'type', is: 'file'},
142
+ {when: 'type', is: 'submit'}, {when: 'type', is: 'image'}, {when: 'type', is: 'reset'},
143
+ {when: 'type', is: 'button'},
144
+ ]);
101
145
  });
102
146
 
103
147
  it('minimizes the data for PointerEvent', () => {
@@ -108,7 +152,7 @@ describe('DOM pinned properties dataset generation', function() {
108
152
  assert.deepEqual(type.props.pressure, {
109
153
  specs: 8,
110
154
  });
111
- assert.strictEqual(type.states, undefined);
155
+ assert.strictEqual(type.rules, undefined);
112
156
  });
113
157
 
114
158
  it('removes the entry for DOMParser in the minimized output', () => {