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.
- package/.eslintignore +1 -0
- package/config/gni/devtools_grd_files.gni +4 -2
- package/front_end/core/common/JavaScriptMetaData.ts +20 -0
- package/front_end/core/i18n/locales/af.json +195 -93
- package/front_end/core/i18n/locales/am.json +191 -89
- package/front_end/core/i18n/locales/ar.json +193 -91
- package/front_end/core/i18n/locales/as.json +192 -90
- package/front_end/core/i18n/locales/az.json +191 -89
- package/front_end/core/i18n/locales/be.json +191 -89
- package/front_end/core/i18n/locales/bg.json +190 -88
- package/front_end/core/i18n/locales/bn.json +191 -89
- package/front_end/core/i18n/locales/bs.json +193 -91
- package/front_end/core/i18n/locales/ca.json +189 -87
- package/front_end/core/i18n/locales/cs.json +191 -89
- package/front_end/core/i18n/locales/cy.json +191 -89
- package/front_end/core/i18n/locales/da.json +191 -89
- package/front_end/core/i18n/locales/de.json +193 -91
- package/front_end/core/i18n/locales/el.json +174 -72
- package/front_end/core/i18n/locales/en-GB.json +132 -30
- package/front_end/core/i18n/locales/en-US.json +3 -3
- package/front_end/core/i18n/locales/en-XL.json +3 -3
- package/front_end/core/i18n/locales/es-419.json +192 -90
- package/front_end/core/i18n/locales/es.json +200 -98
- package/front_end/core/i18n/locales/et.json +190 -88
- package/front_end/core/i18n/locales/eu.json +197 -95
- package/front_end/core/i18n/locales/fa.json +192 -90
- package/front_end/core/i18n/locales/fi.json +192 -90
- package/front_end/core/i18n/locales/fil.json +190 -88
- package/front_end/core/i18n/locales/fr-CA.json +191 -89
- package/front_end/core/i18n/locales/fr.json +192 -90
- package/front_end/core/i18n/locales/gl.json +173 -71
- package/front_end/core/i18n/locales/gu.json +192 -90
- package/front_end/core/i18n/locales/he.json +191 -89
- package/front_end/core/i18n/locales/hi.json +172 -70
- package/front_end/core/i18n/locales/hr.json +180 -78
- package/front_end/core/i18n/locales/hu.json +191 -89
- package/front_end/core/i18n/locales/hy.json +192 -90
- package/front_end/core/i18n/locales/id.json +192 -90
- package/front_end/core/i18n/locales/is.json +176 -74
- package/front_end/core/i18n/locales/it.json +192 -90
- package/front_end/core/i18n/locales/ja.json +190 -88
- package/front_end/core/i18n/locales/ka.json +190 -88
- package/front_end/core/i18n/locales/kk.json +198 -96
- package/front_end/core/i18n/locales/km.json +195 -93
- package/front_end/core/i18n/locales/kn.json +193 -91
- package/front_end/core/i18n/locales/ko.json +190 -88
- package/front_end/core/i18n/locales/ky.json +193 -91
- package/front_end/core/i18n/locales/lo.json +192 -90
- package/front_end/core/i18n/locales/lt.json +193 -91
- package/front_end/core/i18n/locales/lv.json +175 -73
- package/front_end/core/i18n/locales/mk.json +193 -91
- package/front_end/core/i18n/locales/ml.json +193 -91
- package/front_end/core/i18n/locales/mn.json +190 -88
- package/front_end/core/i18n/locales/mr.json +191 -89
- package/front_end/core/i18n/locales/ms.json +190 -88
- package/front_end/core/i18n/locales/my.json +191 -89
- package/front_end/core/i18n/locales/ne.json +172 -70
- package/front_end/core/i18n/locales/nl.json +191 -89
- package/front_end/core/i18n/locales/no.json +191 -89
- package/front_end/core/i18n/locales/or.json +196 -94
- package/front_end/core/i18n/locales/pa.json +191 -89
- package/front_end/core/i18n/locales/pl.json +191 -89
- package/front_end/core/i18n/locales/pt-PT.json +199 -97
- package/front_end/core/i18n/locales/pt.json +191 -89
- package/front_end/core/i18n/locales/ro.json +193 -91
- package/front_end/core/i18n/locales/ru.json +193 -91
- package/front_end/core/i18n/locales/si.json +191 -89
- package/front_end/core/i18n/locales/sk.json +192 -90
- package/front_end/core/i18n/locales/sl.json +191 -89
- package/front_end/core/i18n/locales/sq.json +193 -91
- package/front_end/core/i18n/locales/sr-Latn.json +190 -88
- package/front_end/core/i18n/locales/sr.json +190 -88
- package/front_end/core/i18n/locales/sv.json +191 -89
- package/front_end/core/i18n/locales/sw.json +192 -90
- package/front_end/core/i18n/locales/ta.json +193 -91
- package/front_end/core/i18n/locales/te.json +134 -32
- package/front_end/core/i18n/locales/th.json +190 -88
- package/front_end/core/i18n/locales/tr.json +193 -91
- package/front_end/core/i18n/locales/uk.json +193 -91
- package/front_end/core/i18n/locales/ur.json +191 -89
- package/front_end/core/i18n/locales/uz.json +190 -88
- package/front_end/core/i18n/locales/vi.json +190 -88
- package/front_end/core/i18n/locales/zh-HK.json +192 -90
- package/front_end/core/i18n/locales/zh-TW.json +195 -93
- package/front_end/core/i18n/locales/zh.json +191 -89
- package/front_end/core/i18n/locales/zu.json +192 -90
- package/front_end/core/sdk/DOMModel.ts +9 -0
- package/front_end/core/sdk/DebuggerModel.ts +0 -28
- package/front_end/core/sdk/Script.ts +5 -14
- package/front_end/core/sdk/SourceMap.ts +88 -27
- package/front_end/generated/InspectorBackendCommands.js +7 -3
- package/front_end/generated/protocol-mapping.d.ts +16 -0
- package/front_end/generated/protocol-proxy-api.d.ts +18 -0
- package/front_end/generated/protocol.ts +31 -5
- package/front_end/models/bindings/ResourceScriptMapping.ts +1 -2
- package/front_end/models/emulation/EmulatedDevices.ts +0 -13
- package/front_end/models/javascript_metadata/DOMPinnedProperties.ts +247 -225
- package/front_end/models/javascript_metadata/JavaScriptMetadata.ts +3 -0
- package/front_end/models/javascript_metadata/NativeFunctions.js +4 -4
- package/front_end/models/javascript_metadata/javascript_metadata.ts +3 -0
- package/front_end/models/source_map_scopes/NamesResolver.ts +99 -23
- package/front_end/panels/elements/ElementsTreeElement.ts +7 -3
- package/front_end/panels/elements/components/ElementsBreadcrumbs.ts +3 -4
- package/front_end/panels/elements/components/LayoutPane.ts +3 -4
- package/front_end/panels/elements/components/QueryContainer.ts +3 -4
- package/front_end/panels/elements/components/components.ts +0 -2
- package/front_end/panels/lighthouse/lighthouseStartView.css +3 -1
- package/front_end/panels/sources/ScopeChainSidebarPane.ts +4 -42
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspectorController.ts +64 -8
- package/front_end/{panels/elements/components → ui/components/node_text}/NodeText.ts +2 -1
- package/front_end/{panels/elements/components → ui/components/node_text}/nodeText.css +0 -0
- package/front_end/ui/components/node_text/node_text.ts +9 -0
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +8 -5
- package/front_end/ui/legacy/components/object_ui/objectValue.css +1 -4
- package/package.json +1 -1
- package/scripts/webidl-properties/config.js +305 -239
- package/scripts/webidl-properties/get-props.js +23 -12
- package/scripts/webidl-properties/index.js +14 -9
- package/scripts/webidl-properties/tests.js +58 -14
@@ -35,245 +35,311 @@ export const GLOBAL_ATTRIBUTES = new Set([
|
|
35
35
|
* The "applicable" members for certain "states" that WebIDL types can be in.
|
36
36
|
* In other words, some members are "valid" only valid in certain situations:
|
37
37
|
* for example, with the HTML input element, the set of valid members are
|
38
|
-
* determined by the "type"
|
38
|
+
* determined by the "type" property.
|
39
39
|
*/
|
40
|
-
export const
|
40
|
+
export const APPLICABLE_MEMBERS = {
|
41
41
|
// https://html.spec.whatwg.org/multipage/input.html#input-type-attr-summary
|
42
|
-
HTMLInputElement:
|
43
|
-
|
44
|
-
'
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
'
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
'
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
'
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
'
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
'
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
'
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
'
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
'
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
'
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
'
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
'
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
42
|
+
HTMLInputElement: [
|
43
|
+
{
|
44
|
+
rule: {when: 'type', is: 'hidden'},
|
45
|
+
members: new Set([
|
46
|
+
'autocomplete',
|
47
|
+
'value',
|
48
|
+
])
|
49
|
+
},
|
50
|
+
{
|
51
|
+
rule: {when: 'type', is: 'text'},
|
52
|
+
members: new Set([
|
53
|
+
'autocomplete',
|
54
|
+
'dirname',
|
55
|
+
'list',
|
56
|
+
'maxlength',
|
57
|
+
'minlength',
|
58
|
+
'pattern',
|
59
|
+
'placeholder',
|
60
|
+
'readonly',
|
61
|
+
'required',
|
62
|
+
'size',
|
63
|
+
'value',
|
64
|
+
'list',
|
65
|
+
'selectionstart',
|
66
|
+
'selectionend',
|
67
|
+
'selectiondirection',
|
68
|
+
])
|
69
|
+
},
|
70
|
+
{
|
71
|
+
rule: {when: 'type', is: 'search'},
|
72
|
+
members: new Set([
|
73
|
+
'autocomplete',
|
74
|
+
'dirname',
|
75
|
+
'list',
|
76
|
+
'maxlength',
|
77
|
+
'minlength',
|
78
|
+
'pattern',
|
79
|
+
'placeholder',
|
80
|
+
'readonly',
|
81
|
+
'required',
|
82
|
+
'size',
|
83
|
+
'value',
|
84
|
+
'list',
|
85
|
+
'selectionstart',
|
86
|
+
'selectionend',
|
87
|
+
'selectiondirection',
|
88
|
+
])
|
89
|
+
},
|
90
|
+
{
|
91
|
+
rule: {when: 'type', is: 'url'},
|
92
|
+
members: new Set([
|
93
|
+
'autocomplete',
|
94
|
+
'list',
|
95
|
+
'maxlength',
|
96
|
+
'minlength',
|
97
|
+
'pattern',
|
98
|
+
'placeholder',
|
99
|
+
'readonly',
|
100
|
+
'required',
|
101
|
+
'size',
|
102
|
+
'value',
|
103
|
+
'list',
|
104
|
+
'selectionstart',
|
105
|
+
'selectionend',
|
106
|
+
'selectiondirection',
|
107
|
+
])
|
108
|
+
},
|
109
|
+
{
|
110
|
+
rule: {when: 'type', is: 'tel'},
|
111
|
+
members: new Set([
|
112
|
+
'autocomplete',
|
113
|
+
'list',
|
114
|
+
'maxlength',
|
115
|
+
'minlength',
|
116
|
+
'pattern',
|
117
|
+
'placeholder',
|
118
|
+
'readonly',
|
119
|
+
'required',
|
120
|
+
'size',
|
121
|
+
'value',
|
122
|
+
'list',
|
123
|
+
'selectionstart',
|
124
|
+
'selectionend',
|
125
|
+
'selectiondirection',
|
126
|
+
])
|
127
|
+
},
|
128
|
+
{
|
129
|
+
rule: {when: 'type', is: 'email'},
|
130
|
+
members: new Set([
|
131
|
+
'autocomplete',
|
132
|
+
'list',
|
133
|
+
'maxlength',
|
134
|
+
'minlength',
|
135
|
+
'multiple',
|
136
|
+
'pattern',
|
137
|
+
'placeholder',
|
138
|
+
'readonly',
|
139
|
+
'required',
|
140
|
+
'size',
|
141
|
+
'value',
|
142
|
+
'list',
|
143
|
+
])
|
144
|
+
},
|
145
|
+
{
|
146
|
+
rule: {when: 'type', is: 'password'},
|
147
|
+
members: new Set([
|
148
|
+
'autocomplete',
|
149
|
+
'maxlength',
|
150
|
+
'minlength',
|
151
|
+
'pattern',
|
152
|
+
'placeholder',
|
153
|
+
'readonly',
|
154
|
+
'required',
|
155
|
+
'size',
|
156
|
+
'value',
|
157
|
+
'selectionstart',
|
158
|
+
'selectionend',
|
159
|
+
'selectiondirection',
|
160
|
+
])
|
161
|
+
},
|
162
|
+
{
|
163
|
+
rule: {when: 'type', is: 'date'},
|
164
|
+
members: new Set([
|
165
|
+
'autocomplete',
|
166
|
+
'list',
|
167
|
+
'max',
|
168
|
+
'min',
|
169
|
+
'readonly',
|
170
|
+
'required',
|
171
|
+
'step',
|
172
|
+
'value',
|
173
|
+
'valueasdate',
|
174
|
+
'valueasnumber',
|
175
|
+
'list',
|
176
|
+
])
|
177
|
+
},
|
178
|
+
{
|
179
|
+
rule: {when: 'type', is: 'month'},
|
180
|
+
members: new Set([
|
181
|
+
'autocomplete',
|
182
|
+
'list',
|
183
|
+
'max',
|
184
|
+
'min',
|
185
|
+
'readonly',
|
186
|
+
'required',
|
187
|
+
'step',
|
188
|
+
'value',
|
189
|
+
'valueasdate',
|
190
|
+
'valueasnumber',
|
191
|
+
'list',
|
192
|
+
])
|
193
|
+
},
|
194
|
+
{
|
195
|
+
rule: {when: 'type', is: 'week'},
|
196
|
+
members: new Set([
|
197
|
+
'autocomplete',
|
198
|
+
'list',
|
199
|
+
'max',
|
200
|
+
'min',
|
201
|
+
'readonly',
|
202
|
+
'required',
|
203
|
+
'step',
|
204
|
+
'value',
|
205
|
+
'valueasdate',
|
206
|
+
'valueasnumber',
|
207
|
+
'list',
|
208
|
+
])
|
209
|
+
},
|
210
|
+
{
|
211
|
+
rule: {when: 'type', is: 'time'},
|
212
|
+
members: new Set([
|
213
|
+
'autocomplete',
|
214
|
+
'list',
|
215
|
+
'max',
|
216
|
+
'min',
|
217
|
+
'readonly',
|
218
|
+
'required',
|
219
|
+
'step',
|
220
|
+
'value',
|
221
|
+
'valueasdate',
|
222
|
+
'valueasnumber',
|
223
|
+
'list',
|
224
|
+
])
|
225
|
+
},
|
226
|
+
{
|
227
|
+
rule: {when: 'type', is: 'datetime-local'},
|
228
|
+
members: new Set([
|
229
|
+
'autocomplete',
|
230
|
+
'list',
|
231
|
+
'max',
|
232
|
+
'min',
|
233
|
+
'readonly',
|
234
|
+
'required',
|
235
|
+
'step',
|
236
|
+
'value',
|
237
|
+
'valueasnumber',
|
238
|
+
'list',
|
239
|
+
])
|
240
|
+
},
|
241
|
+
{
|
242
|
+
rule: {when: 'type', is: 'number'},
|
243
|
+
members: new Set([
|
244
|
+
'autocomplete',
|
245
|
+
'list',
|
246
|
+
'max',
|
247
|
+
'min',
|
248
|
+
'placeholder',
|
249
|
+
'readonly',
|
250
|
+
'required',
|
251
|
+
'step',
|
252
|
+
'value',
|
253
|
+
'valueasnumber',
|
254
|
+
'list',
|
255
|
+
])
|
256
|
+
},
|
257
|
+
{
|
258
|
+
rule: {when: 'type', is: 'range'},
|
259
|
+
members: new Set([
|
260
|
+
'autocomplete',
|
261
|
+
'list',
|
262
|
+
'max',
|
263
|
+
'min',
|
264
|
+
'step',
|
265
|
+
'value',
|
266
|
+
'valueasnumber',
|
267
|
+
'list',
|
268
|
+
])
|
269
|
+
},
|
270
|
+
{
|
271
|
+
rule: {when: 'type', is: 'color'},
|
272
|
+
members: new Set([
|
273
|
+
'autocomplete',
|
274
|
+
'list',
|
275
|
+
'value',
|
276
|
+
])
|
277
|
+
},
|
278
|
+
{
|
279
|
+
rule: {when: 'type', is: 'checkbox'},
|
280
|
+
members: new Set([
|
281
|
+
'checked',
|
282
|
+
'required',
|
283
|
+
'checked',
|
284
|
+
'value',
|
285
|
+
])
|
286
|
+
},
|
287
|
+
{
|
288
|
+
rule: {when: 'type', is: 'radio'},
|
289
|
+
members: new Set([
|
290
|
+
'checked',
|
291
|
+
'required',
|
292
|
+
'checked',
|
293
|
+
'value',
|
294
|
+
])
|
295
|
+
},
|
296
|
+
{
|
297
|
+
rule: {when: 'type', is: 'file'},
|
298
|
+
members: new Set([
|
299
|
+
'accept',
|
300
|
+
'multiple',
|
301
|
+
'required',
|
302
|
+
'files',
|
303
|
+
'value',
|
304
|
+
])
|
305
|
+
},
|
306
|
+
{
|
307
|
+
rule: {when: 'type', is: 'submit'},
|
308
|
+
members: new Set([
|
309
|
+
'formaction',
|
310
|
+
'formenctype',
|
311
|
+
'formmethod',
|
312
|
+
'formnovalidate',
|
313
|
+
'formtarget',
|
314
|
+
'value',
|
315
|
+
])
|
316
|
+
},
|
317
|
+
{
|
318
|
+
rule: {when: 'type', is: 'image'},
|
319
|
+
members: new Set([
|
320
|
+
'alt',
|
321
|
+
'formaction',
|
322
|
+
'formenctype',
|
323
|
+
'formmethod',
|
324
|
+
'formnovalidate',
|
325
|
+
'formtarget',
|
326
|
+
'height',
|
327
|
+
'src',
|
328
|
+
'width',
|
329
|
+
'value',
|
330
|
+
])
|
331
|
+
},
|
332
|
+
{
|
333
|
+
rule: {when: 'type', is: 'reset'},
|
334
|
+
members: new Set([
|
335
|
+
'value',
|
336
|
+
])
|
337
|
+
},
|
338
|
+
{
|
339
|
+
rule: {when: 'type', is: 'button'},
|
340
|
+
members: new Set([
|
341
|
+
'value',
|
342
|
+
])
|
343
|
+
},
|
344
|
+
],
|
279
345
|
};
|
@@ -2,7 +2,7 @@
|
|
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 {GLOBAL_ATTRIBUTES, SPECS
|
5
|
+
import {APPLICABLE_MEMBERS, GLOBAL_ATTRIBUTES, SPECS} from './config.js';
|
6
6
|
import {merge} from './util.js';
|
7
7
|
|
8
8
|
/**
|
@@ -40,7 +40,7 @@ function transform({name, idls}, output = {}) {
|
|
40
40
|
case 'dictionary': {
|
41
41
|
output[idl.name] = output[idl.name] ?? makeEntry();
|
42
42
|
let props = idl.members?.filter(member => ACCEPTED_MEMBER_TYPES.has(member.type));
|
43
|
-
props = props?.map(member => [member.name, {
|
43
|
+
props = props?.map(member => [member.name, {specs: [name]}]);
|
44
44
|
merge(output[idl.name], {
|
45
45
|
inheritance: idl.inheritance,
|
46
46
|
props: Object.fromEntries(props),
|
@@ -71,22 +71,33 @@ function transform({name, idls}, output = {}) {
|
|
71
71
|
/**
|
72
72
|
* Adds additional metadata to the DOM pinned properties dataset.
|
73
73
|
*
|
74
|
-
* Currently
|
75
|
-
*
|
74
|
+
* Currently:
|
75
|
+
* - Adds a field specifying whether a member is a global attribute or not.
|
76
|
+
* - Adds information about which properties are "applicable" members for
|
77
|
+
* certain "states" their parent WebIDL type can be in, such as for the
|
78
|
+
* HTMLInputElement where the set of valid members are determined by the "type"
|
79
|
+
* property. See `APPLICABLE_MEMBERS`.
|
76
80
|
*
|
77
81
|
* @param {*} output
|
78
82
|
*/
|
79
83
|
export function addMetadata(output) {
|
80
84
|
for (const [key, value] of Object.entries(output)) {
|
81
|
-
const
|
82
|
-
|
83
|
-
|
85
|
+
for (const [name, prop] of Object.entries(value.props)) {
|
86
|
+
prop.global = GLOBAL_ATTRIBUTES.has(name);
|
87
|
+
|
88
|
+
const rules = APPLICABLE_MEMBERS[key];
|
89
|
+
if (!rules) {
|
90
|
+
continue;
|
91
|
+
}
|
92
|
+
|
93
|
+
for (const {rule, members} of rules) {
|
94
|
+
if (members.has(name.toLowerCase())) {
|
95
|
+
merge(prop, {rules: [rule]});
|
96
|
+
}
|
97
|
+
}
|
98
|
+
|
99
|
+
value.rules = rules.map(({rule}) => rule);
|
84
100
|
}
|
85
|
-
const states = Object.entries(rule).map(([selector, allowlist]) => {
|
86
|
-
const valid = Object.entries(value.props).filter(([prop]) => allowlist.has(prop.toLowerCase()));
|
87
|
-
return [selector, Object.fromEntries(valid)];
|
88
|
-
});
|
89
|
-
value.states = Object.fromEntries(states);
|
90
101
|
}
|
91
102
|
return output;
|
92
103
|
}
|