chrome-devtools-frontend 1.0.974080 → 1.0.974575
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/front_end/core/i18n/locales/af.json +74 -29
- package/front_end/core/i18n/locales/am.json +74 -29
- package/front_end/core/i18n/locales/ar.json +74 -29
- package/front_end/core/i18n/locales/as.json +74 -29
- package/front_end/core/i18n/locales/az.json +74 -29
- package/front_end/core/i18n/locales/be.json +74 -29
- package/front_end/core/i18n/locales/bg.json +74 -29
- package/front_end/core/i18n/locales/bn.json +74 -29
- package/front_end/core/i18n/locales/bs.json +75 -30
- package/front_end/core/i18n/locales/ca.json +74 -29
- package/front_end/core/i18n/locales/cs.json +74 -29
- package/front_end/core/i18n/locales/cy.json +74 -29
- package/front_end/core/i18n/locales/da.json +74 -29
- package/front_end/core/i18n/locales/de.json +76 -31
- package/front_end/core/i18n/locales/el.json +76 -31
- package/front_end/core/i18n/locales/en-GB.json +74 -29
- package/front_end/core/i18n/locales/es-419.json +74 -29
- package/front_end/core/i18n/locales/es.json +74 -29
- package/front_end/core/i18n/locales/et.json +74 -29
- package/front_end/core/i18n/locales/eu.json +76 -31
- package/front_end/core/i18n/locales/fa.json +74 -29
- package/front_end/core/i18n/locales/fi.json +75 -30
- package/front_end/core/i18n/locales/fil.json +74 -29
- package/front_end/core/i18n/locales/fr-CA.json +74 -29
- package/front_end/core/i18n/locales/fr.json +74 -29
- package/front_end/core/i18n/locales/gl.json +81 -36
- package/front_end/core/i18n/locales/gu.json +74 -29
- package/front_end/core/i18n/locales/he.json +74 -29
- package/front_end/core/i18n/locales/hi.json +74 -29
- package/front_end/core/i18n/locales/hr.json +74 -29
- package/front_end/core/i18n/locales/hu.json +74 -29
- package/front_end/core/i18n/locales/hy.json +74 -29
- package/front_end/core/i18n/locales/id.json +74 -29
- package/front_end/core/i18n/locales/is.json +74 -29
- package/front_end/core/i18n/locales/it.json +74 -29
- package/front_end/core/i18n/locales/ja.json +74 -29
- package/front_end/core/i18n/locales/ka.json +74 -29
- package/front_end/core/i18n/locales/kk.json +74 -29
- package/front_end/core/i18n/locales/km.json +74 -29
- package/front_end/core/i18n/locales/kn.json +74 -29
- package/front_end/core/i18n/locales/ko.json +74 -29
- package/front_end/core/i18n/locales/ky.json +74 -29
- package/front_end/core/i18n/locales/lo.json +74 -29
- package/front_end/core/i18n/locales/lt.json +74 -29
- package/front_end/core/i18n/locales/lv.json +74 -29
- package/front_end/core/i18n/locales/mk.json +75 -30
- package/front_end/core/i18n/locales/ml.json +74 -29
- package/front_end/core/i18n/locales/mn.json +74 -29
- package/front_end/core/i18n/locales/mr.json +74 -29
- package/front_end/core/i18n/locales/ms.json +74 -29
- package/front_end/core/i18n/locales/my.json +74 -29
- package/front_end/core/i18n/locales/ne.json +74 -29
- package/front_end/core/i18n/locales/nl.json +74 -29
- package/front_end/core/i18n/locales/no.json +74 -29
- package/front_end/core/i18n/locales/or.json +75 -30
- package/front_end/core/i18n/locales/pa.json +74 -29
- package/front_end/core/i18n/locales/pl.json +74 -29
- package/front_end/core/i18n/locales/pt-PT.json +74 -29
- package/front_end/core/i18n/locales/pt.json +74 -29
- package/front_end/core/i18n/locales/ro.json +74 -29
- package/front_end/core/i18n/locales/ru.json +78 -33
- package/front_end/core/i18n/locales/si.json +74 -29
- package/front_end/core/i18n/locales/sk.json +74 -29
- package/front_end/core/i18n/locales/sl.json +74 -29
- package/front_end/core/i18n/locales/sq.json +74 -29
- package/front_end/core/i18n/locales/sr-Latn.json +74 -29
- package/front_end/core/i18n/locales/sr.json +74 -29
- package/front_end/core/i18n/locales/sv.json +74 -29
- package/front_end/core/i18n/locales/sw.json +74 -29
- package/front_end/core/i18n/locales/ta.json +74 -29
- package/front_end/core/i18n/locales/te.json +75 -30
- package/front_end/core/i18n/locales/th.json +74 -29
- package/front_end/core/i18n/locales/tr.json +74 -29
- package/front_end/core/i18n/locales/uk.json +74 -29
- package/front_end/core/i18n/locales/ur.json +74 -29
- package/front_end/core/i18n/locales/uz.json +74 -29
- package/front_end/core/i18n/locales/vi.json +74 -29
- package/front_end/core/i18n/locales/zh-HK.json +74 -29
- package/front_end/core/i18n/locales/zh-TW.json +74 -29
- package/front_end/core/i18n/locales/zh.json +74 -29
- package/front_end/core/i18n/locales/zu.json +74 -29
- package/front_end/core/sdk/DOMModel.ts +3 -3
- package/front_end/generated/InspectorBackendCommands.js +11 -9
- package/front_end/generated/protocol-mapping.d.ts +13 -0
- package/front_end/generated/protocol-proxy-api.d.ts +15 -0
- package/front_end/generated/protocol.ts +65 -9
- package/front_end/models/javascript_metadata/NativeFunctions.js +87 -19
- package/front_end/panels/console/ConsolePrompt.ts +9 -4
- package/front_end/ui/components/text_editor/cursor_tooltip.ts +2 -1
- package/front_end/ui/components/text_editor/javascript.ts +10 -3
- package/front_end/ui/legacy/Toolbar.ts +25 -13
- package/package.json +1 -1
@@ -1243,10 +1243,10 @@ export class DOMModel extends SDKModel<EventTypes> {
|
|
1243
1243
|
|
1244
1244
|
documentUpdated(): void {
|
1245
1245
|
// If we have this.#pendingDocumentRequestPromise in flight,
|
1246
|
-
//
|
1247
|
-
const documentWasRequested = this.#
|
1246
|
+
// it will contain most recent result.
|
1247
|
+
const documentWasRequested = this.#pendingDocumentRequestPromise;
|
1248
1248
|
this.setDocument(null);
|
1249
|
-
if (this.parentModel() && documentWasRequested) {
|
1249
|
+
if (this.parentModel() && !documentWasRequested) {
|
1250
1250
|
void this.requestDocument();
|
1251
1251
|
}
|
1252
1252
|
}
|
@@ -113,11 +113,7 @@ export function registerCommands(inspectorBackend) {
|
|
113
113
|
['nodes']);
|
114
114
|
inspectorBackend.registerCommand(
|
115
115
|
'Accessibility.getFullAXTree',
|
116
|
-
[
|
117
|
-
{'name': 'depth', 'type': 'number', 'optional': true},
|
118
|
-
{'name': 'max_depth', 'type': 'number', 'optional': true},
|
119
|
-
{'name': 'frameId', 'type': 'string', 'optional': true}
|
120
|
-
],
|
116
|
+
[{'name': 'depth', 'type': 'number', 'optional': true}, {'name': 'frameId', 'type': 'string', 'optional': true}],
|
121
117
|
['nodes']);
|
122
118
|
inspectorBackend.registerCommand(
|
123
119
|
'Accessibility.getRootAXNode', [{'name': 'frameId', 'type': 'string', 'optional': true}], ['node']);
|
@@ -211,6 +207,7 @@ export function registerCommands(inspectorBackend) {
|
|
211
207
|
MixedContentWarning: 'MixedContentWarning'
|
212
208
|
});
|
213
209
|
inspectorBackend.registerEnum('Audits.MixedContentResourceType', {
|
210
|
+
AttributionSrc: 'AttributionSrc',
|
214
211
|
Audio: 'Audio',
|
215
212
|
Beacon: 'Beacon',
|
216
213
|
CSPReport: 'CSPReport',
|
@@ -520,6 +517,8 @@ export function registerCommands(inspectorBackend) {
|
|
520
517
|
'CSS.getPlatformFontsForNode', [{'name': 'nodeId', 'type': 'number', 'optional': false}], ['fonts']);
|
521
518
|
inspectorBackend.registerCommand(
|
522
519
|
'CSS.getStyleSheetText', [{'name': 'styleSheetId', 'type': 'string', 'optional': false}], ['text']);
|
520
|
+
inspectorBackend.registerCommand(
|
521
|
+
'CSS.getLayersForNode', [{'name': 'nodeId', 'type': 'number', 'optional': false}], ['rootLayer']);
|
523
522
|
inspectorBackend.registerCommand(
|
524
523
|
'CSS.trackComputedStyleUpdates', [{'name': 'propertiesToTrack', 'type': 'object', 'optional': false}], []);
|
525
524
|
inspectorBackend.registerCommand('CSS.takeComputedStyleUpdates', [], ['nodeIds']);
|
@@ -656,10 +655,11 @@ export function registerCommands(inspectorBackend) {
|
|
656
655
|
ScrollbarCorner: 'scrollbar-corner',
|
657
656
|
Resizer: 'resizer',
|
658
657
|
InputListButton: 'input-list-button',
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
658
|
+
PageTransition: 'page-transition',
|
659
|
+
PageTransitionContainer: 'page-transition-container',
|
660
|
+
PageTransitionImageWrapper: 'page-transition-image-wrapper',
|
661
|
+
PageTransitionOutgoingImage: 'page-transition-outgoing-image',
|
662
|
+
PageTransitionIncomingImage: 'page-transition-incoming-image'
|
663
663
|
});
|
664
664
|
inspectorBackend.registerEnum('DOM.ShadowRootType', {UserAgent: 'user-agent', Open: 'open', Closed: 'closed'});
|
665
665
|
inspectorBackend.registerEnum(
|
@@ -1153,6 +1153,8 @@ export function registerCommands(inspectorBackend) {
|
|
1153
1153
|
{'name': 'userAgentMetadata', 'type': 'object', 'optional': true}
|
1154
1154
|
],
|
1155
1155
|
[]);
|
1156
|
+
inspectorBackend.registerCommand(
|
1157
|
+
'Emulation.setAutomationOverride', [{'name': 'enabled', 'type': 'boolean', 'optional': false}], []);
|
1156
1158
|
|
1157
1159
|
// HeadlessExperimental.
|
1158
1160
|
inspectorBackend.registerEnum('HeadlessExperimental.ScreenshotParamsFormat', {Jpeg: 'jpeg', Png: 'png'});
|
@@ -976,6 +976,14 @@ export namespace ProtocolMapping {
|
|
976
976
|
*/
|
977
977
|
'CSS.getStyleSheetText':
|
978
978
|
{paramsType: [Protocol.CSS.GetStyleSheetTextRequest]; returnType: Protocol.CSS.GetStyleSheetTextResponse;};
|
979
|
+
/**
|
980
|
+
* Returns all layers parsed by the rendering engine for the tree scope of a node.
|
981
|
+
* Given a DOM element identified by nodeId, getLayersForNode returns the root
|
982
|
+
* layer for the nearest ancestor document or shadow root. The layer root contains
|
983
|
+
* the full layer tree for the tree scope and their ordering.
|
984
|
+
*/
|
985
|
+
'CSS.getLayersForNode':
|
986
|
+
{paramsType: [Protocol.CSS.GetLayersForNodeRequest]; returnType: Protocol.CSS.GetLayersForNodeResponse;};
|
979
987
|
/**
|
980
988
|
* Starts tracking the given computed styles for updates. The specified array of properties
|
981
989
|
* replaces the one previously specified. Pass empty array to disable tracking.
|
@@ -1593,6 +1601,11 @@ export namespace ProtocolMapping {
|
|
1593
1601
|
* Allows overriding user agent with the given string.
|
1594
1602
|
*/
|
1595
1603
|
'Emulation.setUserAgentOverride': {paramsType: [Protocol.Emulation.SetUserAgentOverrideRequest]; returnType: void;};
|
1604
|
+
/**
|
1605
|
+
* Allows overriding the automation flag.
|
1606
|
+
*/
|
1607
|
+
'Emulation.setAutomationOverride':
|
1608
|
+
{paramsType: [Protocol.Emulation.SetAutomationOverrideRequest]; returnType: void;};
|
1596
1609
|
/**
|
1597
1610
|
* Sends a BeginFrame to the target and returns when the frame was completed. Optionally captures a
|
1598
1611
|
* screenshot from the resulting frame. Requires that the target was created with enabled
|
@@ -592,6 +592,15 @@ declare namespace ProtocolProxyApi {
|
|
592
592
|
invoke_getStyleSheetText(params: Protocol.CSS.GetStyleSheetTextRequest):
|
593
593
|
Promise<Protocol.CSS.GetStyleSheetTextResponse>;
|
594
594
|
|
595
|
+
/**
|
596
|
+
* Returns all layers parsed by the rendering engine for the tree scope of a node.
|
597
|
+
* Given a DOM element identified by nodeId, getLayersForNode returns the root
|
598
|
+
* layer for the nearest ancestor document or shadow root. The layer root contains
|
599
|
+
* the full layer tree for the tree scope and their ordering.
|
600
|
+
*/
|
601
|
+
invoke_getLayersForNode(params: Protocol.CSS.GetLayersForNodeRequest):
|
602
|
+
Promise<Protocol.CSS.GetLayersForNodeResponse>;
|
603
|
+
|
595
604
|
/**
|
596
605
|
* Starts tracking the given computed styles for updates. The specified array of properties
|
597
606
|
* replaces the one previously specified. Pass empty array to disable tracking.
|
@@ -1468,6 +1477,12 @@ declare namespace ProtocolProxyApi {
|
|
1468
1477
|
*/
|
1469
1478
|
invoke_setUserAgentOverride(params: Protocol.Emulation.SetUserAgentOverrideRequest):
|
1470
1479
|
Promise<Protocol.ProtocolResponseWithError>;
|
1480
|
+
|
1481
|
+
/**
|
1482
|
+
* Allows overriding the automation flag.
|
1483
|
+
*/
|
1484
|
+
invoke_setAutomationOverride(params: Protocol.Emulation.SetAutomationOverrideRequest):
|
1485
|
+
Promise<Protocol.ProtocolResponseWithError>;
|
1471
1486
|
}
|
1472
1487
|
export interface EmulationDispatcher {
|
1473
1488
|
/**
|
@@ -307,10 +307,6 @@ export namespace Accessibility {
|
|
307
307
|
* If omitted, the full tree is returned.
|
308
308
|
*/
|
309
309
|
depth?: integer;
|
310
|
-
/**
|
311
|
-
* Deprecated. This parameter has been renamed to `depth`. If depth is not provided, max_depth will be used.
|
312
|
-
*/
|
313
|
-
max_depth?: integer;
|
314
310
|
/**
|
315
311
|
* The frame for whose document the AX tree should be retrieved.
|
316
312
|
* If omited, the root frame is used.
|
@@ -758,6 +754,7 @@ export namespace Audits {
|
|
758
754
|
}
|
759
755
|
|
760
756
|
export const enum MixedContentResourceType {
|
757
|
+
AttributionSrc = 'AttributionSrc',
|
761
758
|
Audio = 'Audio',
|
762
759
|
Beacon = 'Beacon',
|
763
760
|
CSPReport = 'CSPReport',
|
@@ -1059,7 +1056,7 @@ export namespace Audits {
|
|
1059
1056
|
/**
|
1060
1057
|
* Represents the failure reason when a federated authentication reason fails.
|
1061
1058
|
* Should be updated alongside RequestIdTokenStatus in
|
1062
|
-
* third_party/blink/public/mojom/
|
1059
|
+
* third_party/blink/public/mojom/devtools/inspector_issue.mojom to include
|
1063
1060
|
* all cases except for success.
|
1064
1061
|
*/
|
1065
1062
|
export const enum FederatedAuthRequestIssueReason {
|
@@ -1924,6 +1921,11 @@ export namespace CSS {
|
|
1924
1921
|
* The array enumerates @supports at-rules starting with the innermost one, going outwards.
|
1925
1922
|
*/
|
1926
1923
|
supports?: CSSSupports[];
|
1924
|
+
/**
|
1925
|
+
* Cascade layer array. Contains the layer hierarchy that this rule belongs to starting
|
1926
|
+
* with the innermost layer and going outwards.
|
1927
|
+
*/
|
1928
|
+
layers?: CSSLayer[];
|
1927
1929
|
}
|
1928
1930
|
|
1929
1931
|
/**
|
@@ -2185,6 +2187,44 @@ export namespace CSS {
|
|
2185
2187
|
styleSheetId?: StyleSheetId;
|
2186
2188
|
}
|
2187
2189
|
|
2190
|
+
/**
|
2191
|
+
* CSS Layer at-rule descriptor.
|
2192
|
+
*/
|
2193
|
+
export interface CSSLayer {
|
2194
|
+
/**
|
2195
|
+
* Layer name.
|
2196
|
+
*/
|
2197
|
+
text: string;
|
2198
|
+
/**
|
2199
|
+
* The associated rule header range in the enclosing stylesheet (if
|
2200
|
+
* available).
|
2201
|
+
*/
|
2202
|
+
range?: SourceRange;
|
2203
|
+
/**
|
2204
|
+
* Identifier of the stylesheet containing this object (if exists).
|
2205
|
+
*/
|
2206
|
+
styleSheetId?: StyleSheetId;
|
2207
|
+
}
|
2208
|
+
|
2209
|
+
/**
|
2210
|
+
* CSS Layer data.
|
2211
|
+
*/
|
2212
|
+
export interface CSSLayerData {
|
2213
|
+
/**
|
2214
|
+
* Layer name.
|
2215
|
+
*/
|
2216
|
+
name: string;
|
2217
|
+
/**
|
2218
|
+
* Direct sub-layers
|
2219
|
+
*/
|
2220
|
+
subLayers?: CSSLayerData[];
|
2221
|
+
/**
|
2222
|
+
* Layer order. The order determines the order of the layer in the cascade order.
|
2223
|
+
* A higher number has higher priority in the cascade order.
|
2224
|
+
*/
|
2225
|
+
order: number;
|
2226
|
+
}
|
2227
|
+
|
2188
2228
|
/**
|
2189
2229
|
* Information about amount of glyphs that were rendered with given font.
|
2190
2230
|
*/
|
@@ -2495,6 +2535,14 @@ export namespace CSS {
|
|
2495
2535
|
text: string;
|
2496
2536
|
}
|
2497
2537
|
|
2538
|
+
export interface GetLayersForNodeRequest {
|
2539
|
+
nodeId: DOM.NodeId;
|
2540
|
+
}
|
2541
|
+
|
2542
|
+
export interface GetLayersForNodeResponse extends ProtocolResponseWithError {
|
2543
|
+
rootLayer: CSSLayerData;
|
2544
|
+
}
|
2545
|
+
|
2498
2546
|
export interface TrackComputedStyleUpdatesRequest {
|
2499
2547
|
propertiesToTrack: CSSComputedStyleProperty[];
|
2500
2548
|
}
|
@@ -2951,10 +2999,11 @@ export namespace DOM {
|
|
2951
2999
|
ScrollbarCorner = 'scrollbar-corner',
|
2952
3000
|
Resizer = 'resizer',
|
2953
3001
|
InputListButton = 'input-list-button',
|
2954
|
-
|
2955
|
-
|
2956
|
-
|
2957
|
-
|
3002
|
+
PageTransition = 'page-transition',
|
3003
|
+
PageTransitionContainer = 'page-transition-container',
|
3004
|
+
PageTransitionImageWrapper = 'page-transition-image-wrapper',
|
3005
|
+
PageTransitionOutgoingImage = 'page-transition-outgoing-image',
|
3006
|
+
PageTransitionIncomingImage = 'page-transition-incoming-image',
|
2958
3007
|
}
|
2959
3008
|
|
2960
3009
|
/**
|
@@ -5351,6 +5400,13 @@ export namespace Emulation {
|
|
5351
5400
|
*/
|
5352
5401
|
userAgentMetadata?: UserAgentMetadata;
|
5353
5402
|
}
|
5403
|
+
|
5404
|
+
export interface SetAutomationOverrideRequest {
|
5405
|
+
/**
|
5406
|
+
* Whether the override should be enabled.
|
5407
|
+
*/
|
5408
|
+
enabled: boolean;
|
5409
|
+
}
|
5354
5410
|
}
|
5355
5411
|
|
5356
5412
|
/**
|
@@ -2634,7 +2634,7 @@ export const NativeFunctions = [
|
|
2634
2634
|
},
|
2635
2635
|
{
|
2636
2636
|
name: 'transitionWhile',
|
2637
|
-
signatures: [['newNavigationAction']]
|
2637
|
+
signatures: [['newNavigationAction','?options']]
|
2638
2638
|
},
|
2639
2639
|
{
|
2640
2640
|
name: 'updateCurrent',
|
@@ -2783,6 +2783,10 @@ export const NativeFunctions = [
|
|
2783
2783
|
name: 'CSSKeywordValue',
|
2784
2784
|
signatures: [['keyword']]
|
2785
2785
|
},
|
2786
|
+
{
|
2787
|
+
name: 'CSSMathClamp',
|
2788
|
+
signatures: [['lower','value','upper']]
|
2789
|
+
},
|
2786
2790
|
{
|
2787
2791
|
name: 'CSSMathInvert',
|
2788
2792
|
signatures: [['arg']]
|
@@ -2907,6 +2911,14 @@ export const NativeFunctions = [
|
|
2907
2911
|
name: 'vh',
|
2908
2912
|
signatures: [['value']]
|
2909
2913
|
},
|
2914
|
+
{
|
2915
|
+
name: 'vi',
|
2916
|
+
signatures: [['value']]
|
2917
|
+
},
|
2918
|
+
{
|
2919
|
+
name: 'vb',
|
2920
|
+
signatures: [['value']]
|
2921
|
+
},
|
2910
2922
|
{
|
2911
2923
|
name: 'vmin',
|
2912
2924
|
signatures: [['value']]
|
@@ -2915,6 +2927,78 @@ export const NativeFunctions = [
|
|
2915
2927
|
name: 'vmax',
|
2916
2928
|
signatures: [['value']]
|
2917
2929
|
},
|
2930
|
+
{
|
2931
|
+
name: 'svw',
|
2932
|
+
signatures: [['value']]
|
2933
|
+
},
|
2934
|
+
{
|
2935
|
+
name: 'svh',
|
2936
|
+
signatures: [['value']]
|
2937
|
+
},
|
2938
|
+
{
|
2939
|
+
name: 'svi',
|
2940
|
+
signatures: [['value']]
|
2941
|
+
},
|
2942
|
+
{
|
2943
|
+
name: 'svb',
|
2944
|
+
signatures: [['value']]
|
2945
|
+
},
|
2946
|
+
{
|
2947
|
+
name: 'svmin',
|
2948
|
+
signatures: [['value']]
|
2949
|
+
},
|
2950
|
+
{
|
2951
|
+
name: 'svmax',
|
2952
|
+
signatures: [['value']]
|
2953
|
+
},
|
2954
|
+
{
|
2955
|
+
name: 'lvw',
|
2956
|
+
signatures: [['value']]
|
2957
|
+
},
|
2958
|
+
{
|
2959
|
+
name: 'lvh',
|
2960
|
+
signatures: [['value']]
|
2961
|
+
},
|
2962
|
+
{
|
2963
|
+
name: 'lvi',
|
2964
|
+
signatures: [['value']]
|
2965
|
+
},
|
2966
|
+
{
|
2967
|
+
name: 'lvb',
|
2968
|
+
signatures: [['value']]
|
2969
|
+
},
|
2970
|
+
{
|
2971
|
+
name: 'lvmin',
|
2972
|
+
signatures: [['value']]
|
2973
|
+
},
|
2974
|
+
{
|
2975
|
+
name: 'lvmax',
|
2976
|
+
signatures: [['value']]
|
2977
|
+
},
|
2978
|
+
{
|
2979
|
+
name: 'dvw',
|
2980
|
+
signatures: [['value']]
|
2981
|
+
},
|
2982
|
+
{
|
2983
|
+
name: 'dvh',
|
2984
|
+
signatures: [['value']]
|
2985
|
+
},
|
2986
|
+
{
|
2987
|
+
name: 'dvi',
|
2988
|
+
signatures: [['value']]
|
2989
|
+
},
|
2990
|
+
{
|
2991
|
+
name: 'dvb',
|
2992
|
+
signatures: [['value']]
|
2993
|
+
},
|
2994
|
+
{
|
2995
|
+
name: 'dvmin',
|
2996
|
+
signatures: [['value']]
|
2997
|
+
},
|
2998
|
+
{
|
2999
|
+
name: 'dvmax',
|
3000
|
+
signatures: [['value']]
|
3001
|
+
},
|
2918
3002
|
{
|
2919
3003
|
name: 'qw',
|
2920
3004
|
signatures: [['value']]
|
@@ -3625,14 +3709,6 @@ export const NativeFunctions = [
|
|
3625
3709
|
name: 'dispatchEvent',
|
3626
3710
|
signatures: [['event']]
|
3627
3711
|
},
|
3628
|
-
{
|
3629
|
-
name: 'Event',
|
3630
|
-
signatures: [['type','?eventInitDict']]
|
3631
|
-
},
|
3632
|
-
{
|
3633
|
-
name: 'initEvent',
|
3634
|
-
signatures: [['type','?bubbles','?cancelable']]
|
3635
|
-
},
|
3636
3712
|
{
|
3637
3713
|
name: 'MutationObserver',
|
3638
3714
|
signatures: [['callback']]
|
@@ -4513,7 +4589,8 @@ export const NativeFunctions = [
|
|
4513
4589
|
},
|
4514
4590
|
{
|
4515
4591
|
name: 'end',
|
4516
|
-
signatures: [['index']]
|
4592
|
+
signatures: [['index']],
|
4593
|
+
receiver: 'TimeRanges'
|
4517
4594
|
},
|
4518
4595
|
{
|
4519
4596
|
name: 'getTrackById',
|
@@ -6659,11 +6736,6 @@ export const NativeFunctions = [
|
|
6659
6736
|
name: 'requestAll',
|
6660
6737
|
signatures: [['permissions']]
|
6661
6738
|
},
|
6662
|
-
{
|
6663
|
-
name: 'requestPictureInPicture',
|
6664
|
-
signatures: [['?options']],
|
6665
|
-
receiver: 'HTMLElement'
|
6666
|
-
},
|
6667
6739
|
{
|
6668
6740
|
name: 'PictureInPictureEvent',
|
6669
6741
|
signatures: [['type','eventInitDict']]
|
@@ -8544,10 +8616,6 @@ export const NativeFunctions = [
|
|
8544
8616
|
name: 'requestAdapter',
|
8545
8617
|
signatures: [['?options']]
|
8546
8618
|
},
|
8547
|
-
{
|
8548
|
-
name: 'provide',
|
8549
|
-
signatures: [['?id_token']]
|
8550
|
-
},
|
8551
8619
|
{
|
8552
8620
|
name: 'MIDIConnectionEvent',
|
8553
8621
|
signatures: [['type','?eventInitDict']]
|
@@ -41,6 +41,10 @@ export class ConsolePrompt extends Common.ObjectWrapper.eventMixin<EventTypes, t
|
|
41
41
|
private readonly eagerEvalSetting: Common.Settings.Setting<boolean>;
|
42
42
|
private previewRequestForTest: Promise<void>|null;
|
43
43
|
private highlightingNode: boolean;
|
44
|
+
// The CodeMirror state field that controls whether the argument hints are showing.
|
45
|
+
// If they are, the escape key will clear them. However, if they aren't, then the
|
46
|
+
// console drawer should be hidden as a whole.
|
47
|
+
#argumentHintsState: CodeMirror.StateField<CodeMirror.Tooltip|null>;
|
44
48
|
|
45
49
|
constructor() {
|
46
50
|
super();
|
@@ -70,13 +74,15 @@ export class ConsolePrompt extends Common.ObjectWrapper.eventMixin<EventTypes, t
|
|
70
74
|
this.element.tabIndex = 0;
|
71
75
|
this.previewRequestForTest = null;
|
72
76
|
this.highlightingNode = false;
|
77
|
+
const argumentHints = TextEditor.JavaScript.argumentHints();
|
78
|
+
this.#argumentHintsState = argumentHints[0];
|
73
79
|
|
74
80
|
const editorState = CodeMirror.EditorState.create({
|
75
81
|
doc: this.initialText,
|
76
82
|
extensions: [
|
77
83
|
CodeMirror.keymap.of(this.editorKeymap()),
|
78
84
|
CodeMirror.EditorView.updateListener.of(update => this.editorUpdate(update)),
|
79
|
-
|
85
|
+
argumentHints,
|
80
86
|
TextEditor.JavaScript.completion(),
|
81
87
|
TextEditor.Config.showCompletionHint,
|
82
88
|
CodeMirror.javascript.javascript(),
|
@@ -212,8 +218,7 @@ export class ConsolePrompt extends Common.ObjectWrapper.eventMixin<EventTypes, t
|
|
212
218
|
{
|
213
219
|
key: 'Escape',
|
214
220
|
run: (): boolean => {
|
215
|
-
TextEditor.JavaScript.closeArgumentsHintsTooltip(this.editor.editor);
|
216
|
-
return true;
|
221
|
+
return TextEditor.JavaScript.closeArgumentsHintsTooltip(this.editor.editor, this.#argumentHintsState);
|
217
222
|
},
|
218
223
|
},
|
219
224
|
{
|
@@ -266,7 +271,7 @@ export class ConsolePrompt extends Common.ObjectWrapper.eventMixin<EventTypes, t
|
|
266
271
|
private async handleEnter(): Promise<void> {
|
267
272
|
if (await this.enterWillEvaluate()) {
|
268
273
|
this.appendCommand(this.text(), true);
|
269
|
-
TextEditor.JavaScript.closeArgumentsHintsTooltip(this.editor.editor);
|
274
|
+
TextEditor.JavaScript.closeArgumentsHintsTooltip(this.editor.editor, this.#argumentHintsState);
|
270
275
|
this.editor.dispatch({
|
271
276
|
changes: {from: 0, to: this.editor.state.doc.length},
|
272
277
|
scrollIntoView: true,
|
@@ -4,11 +4,12 @@
|
|
4
4
|
|
5
5
|
import * as CodeMirror from '../../../third_party/codemirror.next/codemirror.next.js';
|
6
6
|
|
7
|
+
export type ArgumentHintsTooltip = [CodeMirror.StateField<CodeMirror.Tooltip|null>, CodeMirror.ViewPlugin<{}>];
|
7
8
|
export const closeTooltip = CodeMirror.StateEffect.define<null>();
|
8
9
|
|
9
10
|
export function cursorTooltip(
|
10
11
|
source: (state: CodeMirror.EditorState, pos: number) => Promise<(() => CodeMirror.TooltipView)|null>,
|
11
|
-
):
|
12
|
+
): ArgumentHintsTooltip {
|
12
13
|
const openTooltip = CodeMirror.StateEffect.define<() => CodeMirror.TooltipView>();
|
13
14
|
|
14
15
|
const state = CodeMirror.StateField.define<null|CodeMirror.Tooltip>({
|
@@ -8,7 +8,7 @@ import * as JavaScriptMetaData from '../../../models/javascript_metadata/javascr
|
|
8
8
|
import * as CodeMirror from '../../../third_party/codemirror.next/codemirror.next.js';
|
9
9
|
import * as UI from '../../legacy/legacy.js';
|
10
10
|
|
11
|
-
import {closeTooltip, cursorTooltip} from './cursor_tooltip.js';
|
11
|
+
import {type ArgumentHintsTooltip, closeTooltip, cursorTooltip} from './cursor_tooltip.js';
|
12
12
|
|
13
13
|
export function completion(): CodeMirror.Extension {
|
14
14
|
return CodeMirror.javascript.javascriptLanguage.data.of({
|
@@ -421,12 +421,19 @@ export async function isExpressionComplete(expression: string): Promise<boolean>
|
|
421
421
|
return false;
|
422
422
|
}
|
423
423
|
|
424
|
-
export function argumentHints():
|
424
|
+
export function argumentHints(): ArgumentHintsTooltip {
|
425
425
|
return cursorTooltip(getArgumentHints);
|
426
426
|
}
|
427
427
|
|
428
|
-
export function closeArgumentsHintsTooltip(
|
428
|
+
export function closeArgumentsHintsTooltip(
|
429
|
+
view: CodeMirror.EditorView, tooltip: CodeMirror.StateField<CodeMirror.Tooltip|null>): boolean {
|
430
|
+
// If the tooltip is currently showing, the state will reflect its properties.
|
431
|
+
// If it isn't showing, the state is explicitly set to `null`.
|
432
|
+
if (view.state.field(tooltip) === null) {
|
433
|
+
return false;
|
434
|
+
}
|
429
435
|
view.dispatch({effects: closeTooltip.of(null)});
|
436
|
+
return true;
|
430
437
|
}
|
431
438
|
|
432
439
|
async function getArgumentHints(
|
@@ -542,6 +542,7 @@ export class ToolbarButton extends ToolbarItem<ToolbarButton.EventTypes> {
|
|
542
542
|
private textElement: HTMLElement;
|
543
543
|
private text?: string;
|
544
544
|
private glyph?: string;
|
545
|
+
private icon?: HTMLElement;
|
545
546
|
/**
|
546
547
|
* TODO(crbug.com/1126026): remove glyph parameter in favor of icon.
|
547
548
|
*/
|
@@ -557,11 +558,8 @@ export class ToolbarButton extends ToolbarItem<ToolbarButton.EventTypes> {
|
|
557
558
|
this.textElement = this.element.createChild('div', 'toolbar-text hidden');
|
558
559
|
|
559
560
|
this.setTitle(title);
|
560
|
-
if (glyphOrIcon
|
561
|
-
|
562
|
-
this.element.append(glyphOrIcon);
|
563
|
-
} else if (glyphOrIcon) {
|
564
|
-
this.setGlyph(glyphOrIcon);
|
561
|
+
if (glyphOrIcon) {
|
562
|
+
this.setGlyphOrIcon(glyphOrIcon);
|
565
563
|
}
|
566
564
|
this.setText(text || '');
|
567
565
|
this.title = '';
|
@@ -580,6 +578,20 @@ export class ToolbarButton extends ToolbarItem<ToolbarButton.EventTypes> {
|
|
580
578
|
this.text = text;
|
581
579
|
}
|
582
580
|
|
581
|
+
setGlyphOrIcon(glyphOrIcon: string|HTMLElement): void {
|
582
|
+
if (glyphOrIcon instanceof HTMLElement) {
|
583
|
+
glyphOrIcon.classList.add('toolbar-icon');
|
584
|
+
if (this.icon) {
|
585
|
+
this.icon.replaceWith(glyphOrIcon);
|
586
|
+
} else {
|
587
|
+
this.element.appendChild(glyphOrIcon);
|
588
|
+
}
|
589
|
+
this.icon = glyphOrIcon;
|
590
|
+
} else if (glyphOrIcon) {
|
591
|
+
this.setGlyph(glyphOrIcon);
|
592
|
+
}
|
593
|
+
}
|
594
|
+
|
583
595
|
setGlyph(glyph: string): void {
|
584
596
|
if (this.glyph === glyph) {
|
585
597
|
return;
|
@@ -739,14 +751,14 @@ export namespace ToolbarInput {
|
|
739
751
|
|
740
752
|
export class ToolbarToggle extends ToolbarButton {
|
741
753
|
private toggledInternal: boolean;
|
742
|
-
private readonly
|
743
|
-
private readonly
|
754
|
+
private readonly untoggledGlyphOrIcon: string|HTMLElement|undefined;
|
755
|
+
private readonly toggledGlyphOrIcon: string|HTMLElement|undefined;
|
744
756
|
|
745
|
-
constructor(title: string,
|
746
|
-
super(title,
|
757
|
+
constructor(title: string, glyphOrIcon?: string|HTMLElement, toggledGlyphOrIcon?: string|HTMLElement) {
|
758
|
+
super(title, glyphOrIcon, '');
|
747
759
|
this.toggledInternal = false;
|
748
|
-
this.
|
749
|
-
this.
|
760
|
+
this.untoggledGlyphOrIcon = glyphOrIcon;
|
761
|
+
this.toggledGlyphOrIcon = toggledGlyphOrIcon;
|
750
762
|
this.element.classList.add('toolbar-state-off');
|
751
763
|
ARIAUtils.setPressed(this.element, false);
|
752
764
|
}
|
@@ -763,8 +775,8 @@ export class ToolbarToggle extends ToolbarButton {
|
|
763
775
|
this.element.classList.toggle('toolbar-state-on', toggled);
|
764
776
|
this.element.classList.toggle('toolbar-state-off', !toggled);
|
765
777
|
ARIAUtils.setPressed(this.element, toggled);
|
766
|
-
if (this.
|
767
|
-
this.
|
778
|
+
if (this.toggledGlyphOrIcon && this.untoggledGlyphOrIcon) {
|
779
|
+
this.setGlyphOrIcon(toggled ? this.toggledGlyphOrIcon : this.untoggledGlyphOrIcon);
|
768
780
|
}
|
769
781
|
}
|
770
782
|
|
package/package.json
CHANGED