chrome-devtools-frontend 1.0.950001 → 1.0.950971
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/config/gni/devtools_grd_files.gni +0 -1
- package/docs/triage_guidelines.md +2 -2
- package/front_end/core/dom_extension/DOMExtension.ts +1 -1
- package/front_end/core/host/InspectorFrontendHostAPI.ts +0 -1
- package/front_end/core/host/UserMetrics.ts +1 -14
- package/front_end/core/platform/platform.ts +1 -2
- package/front_end/core/platform/typescript-utilities.ts +4 -0
- package/front_end/devtools_compatibility.js +0 -1
- package/front_end/entrypoints/device_mode_emulation_frame/device_mode_emulation_frame.ts +2 -7
- package/front_end/entrypoints/main/MainImpl.ts +1 -3
- package/front_end/models/issues_manager/AttributionReportingIssue.ts +37 -6
- package/front_end/panels/animation/animationTimeline.css +2 -1
- package/front_end/panels/console/ConsolePrompt.ts +14 -8
- package/front_end/panels/profiler/heapProfiler.css +1 -1
- package/front_end/panels/settings/settingsScreen.css +8 -3
- package/front_end/panels/sources/BreakpointEditDialog.ts +8 -5
- package/front_end/panels/timeline/TimelinePanel.ts +5 -4
- package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
- package/front_end/third_party/codemirror.next/codemirror.next.d.ts +15 -0
- package/front_end/third_party/codemirror.next/package.json +3 -3
- package/front_end/ui/components/markdown_view/MarkdownLinksMap.ts +16 -0
- package/front_end/ui/components/report_view/report.css +0 -1
- package/front_end/ui/components/text_editor/config.ts +7 -4
- package/front_end/ui/components/text_editor/javascript.ts +16 -7
- package/inspector_overlay/main.ts +16 -2
- package/package.json +1 -1
- package/scripts/build/ninja/copy.gni +2 -2
- package/front_end/core/platform/utilities.ts +0 -49
|
@@ -2029,6 +2029,11 @@ declare abstract class WidgetType {
|
|
|
2029
2029
|
events.
|
|
2030
2030
|
*/
|
|
2031
2031
|
ignoreEvent(_event: Event): boolean;
|
|
2032
|
+
/**
|
|
2033
|
+
This is called when the an instance of the widget is removed
|
|
2034
|
+
from the editor view.
|
|
2035
|
+
*/
|
|
2036
|
+
destroy(_dom: HTMLElement): void;
|
|
2032
2037
|
}
|
|
2033
2038
|
/**
|
|
2034
2039
|
A decoration set represents a collection of decorated ranges,
|
|
@@ -2759,6 +2764,11 @@ declare class EditorView {
|
|
|
2759
2764
|
Find the DOM parent node and offset (child offset if `node` is
|
|
2760
2765
|
an element, character offset when it is a text node) at the
|
|
2761
2766
|
given document position.
|
|
2767
|
+
|
|
2768
|
+
Note that for positions that aren't currently in
|
|
2769
|
+
`visibleRanges`, the resulting DOM position isn't necessarily
|
|
2770
|
+
meaningful (it may just point before or after a placeholder
|
|
2771
|
+
element).
|
|
2762
2772
|
*/
|
|
2763
2773
|
domAtPos(pos: number): {
|
|
2764
2774
|
node: Node;
|
|
@@ -4639,6 +4649,11 @@ declare abstract class GutterMarker extends RangeValue {
|
|
|
4639
4649
|
element that contains this marker.
|
|
4640
4650
|
*/
|
|
4641
4651
|
elementClass: string;
|
|
4652
|
+
/**
|
|
4653
|
+
Called if the marker has a `toDOM` method and its representation
|
|
4654
|
+
was removed from a gutter.
|
|
4655
|
+
*/
|
|
4656
|
+
destroy(dom: Node): void;
|
|
4642
4657
|
}
|
|
4643
4658
|
declare type Handlers = {
|
|
4644
4659
|
[event: string]: (view: EditorView, line: BlockInfo, event: Event) => boolean;
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@codemirror/autocomplete": "0.19.9",
|
|
7
7
|
"@codemirror/closebrackets": "0.19.0",
|
|
8
|
-
"@codemirror/commands": "0.19.
|
|
8
|
+
"@codemirror/commands": "0.19.6",
|
|
9
9
|
"@codemirror/comment": "0.19.0",
|
|
10
10
|
"@codemirror/fold": "0.19.2",
|
|
11
|
-
"@codemirror/gutter": "0.19.
|
|
11
|
+
"@codemirror/gutter": "0.19.9",
|
|
12
12
|
"@codemirror/highlight": "0.19.6",
|
|
13
13
|
"@codemirror/history": "0.19.0",
|
|
14
14
|
"@codemirror/lang-cpp": "0.19.1",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"@codemirror/stream-parser": "0.19.2",
|
|
33
33
|
"@codemirror/text": "0.19.5",
|
|
34
34
|
"@codemirror/tooltip": "0.19.10",
|
|
35
|
-
"@codemirror/view": "0.19.
|
|
35
|
+
"@codemirror/view": "0.19.29",
|
|
36
36
|
"@lezer/common": "0.15.10",
|
|
37
37
|
"@lezer/lr": "0.15.5",
|
|
38
38
|
"@rollup/plugin-node-resolve": "^13.0.4",
|
|
@@ -27,9 +27,25 @@ export const markdownLinks = new Map<string, string>([
|
|
|
27
27
|
],
|
|
28
28
|
['issueQuirksModeDoctype', 'https://web.dev/doctype/'],
|
|
29
29
|
['sameSiteAndSameOrigin', 'https://web.dev/same-site-same-origin/'],
|
|
30
|
+
// Link URLs for deprecation issues (see blink::Deprecation)
|
|
31
|
+
['https://xhr.spec.whatwg.org/', 'https://xhr.spec.whatwg.org/'],
|
|
32
|
+
['https://goo.gl/rStTGz', 'https://goo.gl/rStTGz'],
|
|
33
|
+
['https://webrtc.org/web-apis/chrome/unified-plan/', 'https://webrtc.org/web-apis/chrome/unified-plan/'],
|
|
34
|
+
[
|
|
35
|
+
'https://developer.chrome.com/blog/enabling-shared-array-buffer/',
|
|
36
|
+
'https://developer.chrome.com/blog/enabling-shared-array-buffer/',
|
|
37
|
+
],
|
|
38
|
+
['https://developer.chrome.com/docs/extensions/mv3/', 'https://developer.chrome.com/docs/extensions/mv3/'],
|
|
39
|
+
[
|
|
40
|
+
'https://developer.chrome.com/blog/immutable-document-domain',
|
|
41
|
+
'https://developer.chrome.com/blog/immutable-document-domain',
|
|
42
|
+
],
|
|
30
43
|
]);
|
|
31
44
|
|
|
32
45
|
export const getMarkdownLink = (key: string): string => {
|
|
46
|
+
if (/^https:\/\/www.chromestatus.com\/feature\/\d+$/.test(key)) {
|
|
47
|
+
return key;
|
|
48
|
+
}
|
|
33
49
|
const link = markdownLinks.get(key);
|
|
34
50
|
if (!link) {
|
|
35
51
|
throw new Error(`Markdown link with key '${key}' is not available, please check MarkdownLinksMap.ts`);
|
|
@@ -70,10 +70,13 @@ export const tabMovesFocus = DynamicSetting.bool('textEditorTabMovesFocus', [],
|
|
|
70
70
|
shift: (view: CM.EditorView): boolean => view.state.doc.length ? CM.indentLess(view) : false,
|
|
71
71
|
}]));
|
|
72
72
|
|
|
73
|
-
export const autocompletion =
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
73
|
+
export const autocompletion: CM.Extension = [
|
|
74
|
+
CM.autocompletion({
|
|
75
|
+
icons: false,
|
|
76
|
+
optionClass: (option: CM.Completion): string => option.type === 'secondary' ? 'cm-secondaryCompletion' : '',
|
|
77
|
+
}),
|
|
78
|
+
CM.Prec.highest(CM.keymap.of([{key: 'ArrowRight', run: CM.acceptCompletion}])),
|
|
79
|
+
];
|
|
77
80
|
|
|
78
81
|
export const sourcesAutocompletion = DynamicSetting.bool('textEditorAutocompletion', autocompletion);
|
|
79
82
|
|
|
@@ -402,13 +402,22 @@ async function completeExpressionGlobal(): Promise<CompletionSet> {
|
|
|
402
402
|
return fetchNames;
|
|
403
403
|
}
|
|
404
404
|
|
|
405
|
-
export function isExpressionComplete(
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
405
|
+
export async function isExpressionComplete(expression: string): Promise<boolean> {
|
|
406
|
+
const currentExecutionContext = UI.Context.Context.instance().flavor(SDK.RuntimeModel.ExecutionContext);
|
|
407
|
+
if (!currentExecutionContext) {
|
|
408
|
+
return true;
|
|
409
|
+
}
|
|
410
|
+
const result =
|
|
411
|
+
await currentExecutionContext.runtimeModel.compileScript(expression, '', false, currentExecutionContext.id);
|
|
412
|
+
if (!result || !result.exceptionDetails || !result.exceptionDetails.exception) {
|
|
413
|
+
return true;
|
|
414
|
+
}
|
|
415
|
+
const description = result.exceptionDetails.exception.description;
|
|
416
|
+
if (description) {
|
|
417
|
+
return !description.startsWith('SyntaxError: Unexpected end of input') &&
|
|
418
|
+
!description.startsWith('SyntaxError: Unterminated template literal');
|
|
419
|
+
}
|
|
420
|
+
return false;
|
|
412
421
|
}
|
|
413
422
|
|
|
414
423
|
export function argumentHints(): CodeMirror.Extension {
|
|
@@ -80,10 +80,17 @@ type MessageLookup = {
|
|
|
80
80
|
drawingFinished: '',
|
|
81
81
|
};
|
|
82
82
|
|
|
83
|
+
let queue: unknown[][] = [];
|
|
84
|
+
let prevQueue: string = '';
|
|
85
|
+
|
|
83
86
|
const dispatch = <K extends keyof MessageLookup>(message: [a: K, b: MessageLookup[K]]) => {
|
|
84
87
|
const functionName = message[0];
|
|
85
88
|
if (functionName === 'setOverlay') {
|
|
86
89
|
const overlayName = message[1] as keyof Overlays;
|
|
90
|
+
// No need to swap overlays if it's the same overlay.
|
|
91
|
+
if (overlays[overlayName] === currentOverlay) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
87
94
|
if (currentOverlay) {
|
|
88
95
|
currentOverlay.uninstall();
|
|
89
96
|
}
|
|
@@ -97,9 +104,16 @@ const dispatch = <K extends keyof MessageLookup>(message: [a: K, b: MessageLooku
|
|
|
97
104
|
} else if (functionName === 'setPlatform') {
|
|
98
105
|
platformName = message[1];
|
|
99
106
|
} else if (functionName === 'drawingFinished') {
|
|
100
|
-
|
|
107
|
+
const currentQueue = JSON.stringify(queue);
|
|
108
|
+
if (currentQueue !== prevQueue) {
|
|
109
|
+
for (const message of queue) {
|
|
110
|
+
currentOverlay.dispatch(message);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
prevQueue = currentQueue;
|
|
114
|
+
queue = [];
|
|
101
115
|
} else {
|
|
102
|
-
|
|
116
|
+
queue.push(message);
|
|
103
117
|
}
|
|
104
118
|
};
|
|
105
119
|
|
package/package.json
CHANGED
|
@@ -16,8 +16,8 @@ template("copy_to_gen") {
|
|
|
16
16
|
|
|
17
17
|
script = "scripts/build/ninja/copy-files.js"
|
|
18
18
|
|
|
19
|
-
_copy_src = rebase_path(get_path_info(target_name, "dir"))
|
|
20
|
-
_copy_dest = rebase_path(target_gen_dir)
|
|
19
|
+
_copy_src = rebase_path(get_path_info(target_name, "dir"), root_build_dir)
|
|
20
|
+
_copy_dest = rebase_path(target_gen_dir, root_build_dir)
|
|
21
21
|
|
|
22
22
|
args = [
|
|
23
23
|
_copy_src,
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
// Copyright 2020 The Chromium Authors. All rights reserved.
|
|
2
|
-
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
-
// found in the LICENSE file.
|
|
4
|
-
|
|
5
|
-
/*
|
|
6
|
-
* Copyright (C) 2007 Apple Inc. All rights reserved.
|
|
7
|
-
* Copyright (C) 2012 Google Inc. All rights reserved.
|
|
8
|
-
*
|
|
9
|
-
* Redistribution and use in source and binary forms, with or without
|
|
10
|
-
* modification, are permitted provided that the following conditions
|
|
11
|
-
* are met:
|
|
12
|
-
*
|
|
13
|
-
* 1. Redistributions of source code must retain the above copyright
|
|
14
|
-
* notice, this list of conditions and the following disclaimer.
|
|
15
|
-
* 2. Redistributions in binary form must reproduce the above copyright
|
|
16
|
-
* notice, this list of conditions and the following disclaimer in the
|
|
17
|
-
* documentation and/or other materials provided with the distribution.
|
|
18
|
-
* 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
|
|
19
|
-
* its contributors may be used to endorse or promote products derived
|
|
20
|
-
* from this software without specific prior written permission.
|
|
21
|
-
*
|
|
22
|
-
* THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
|
|
23
|
-
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
24
|
-
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
25
|
-
* DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
|
|
26
|
-
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
27
|
-
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
28
|
-
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
29
|
-
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
30
|
-
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
31
|
-
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
32
|
-
*/
|
|
33
|
-
|
|
34
|
-
export function runOnWindowLoad(callback: () => void): void {
|
|
35
|
-
function windowLoaded(): void {
|
|
36
|
-
window.removeEventListener('DOMContentLoaded', windowLoaded, false);
|
|
37
|
-
callback();
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
if (document.readyState === 'complete' || document.readyState === 'interactive') {
|
|
41
|
-
callback();
|
|
42
|
-
} else {
|
|
43
|
-
window.addEventListener('DOMContentLoaded', windowLoaded, false);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export function assertNever(type: never, message: string): never {
|
|
48
|
-
throw new Error(message);
|
|
49
|
-
}
|