chrome-devtools-frontend 1.0.930109 → 1.0.930993
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 +2 -1
- package/front_end/core/host/InspectorFrontendHost.ts +8 -1
- package/front_end/core/host/InspectorFrontendHostAPI.ts +12 -0
- package/front_end/core/i18n/locales/en-US.json +3 -0
- package/front_end/core/i18n/locales/en-XL.json +3 -0
- package/front_end/core/protocol_client/InspectorBackend.ts +71 -71
- package/front_end/core/sdk/NetworkManager.ts +6 -2
- package/front_end/devtools_compatibility.js +8 -0
- package/front_end/legacy_test_runner/sources_test_runner/DebuggerTestRunner.js +2 -2
- package/front_end/legacy_test_runner/test_runner/TestRunner.js +2 -3
- package/front_end/models/bindings/BreakpointManager.ts +158 -154
- package/front_end/models/bindings/CSSWorkspaceBinding.ts +64 -56
- package/front_end/models/bindings/CompilerScriptMapping.ts +70 -70
- package/front_end/models/bindings/ContentProviderBasedProject.ts +20 -20
- package/front_end/models/bindings/DebuggerLanguagePlugins.ts +132 -132
- package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +73 -72
- package/front_end/models/bindings/DefaultScriptMapping.ts +22 -22
- package/front_end/models/bindings/FileUtils.ts +81 -81
- package/front_end/models/bindings/IgnoreListManager.ts +17 -17
- package/front_end/models/bindings/LiveLocation.ts +21 -21
- package/front_end/models/bindings/PresentationConsoleMessageHelper.ts +28 -28
- package/front_end/models/bindings/ResourceMapping.ts +50 -50
- package/front_end/models/bindings/ResourceScriptMapping.ts +71 -71
- package/front_end/models/bindings/SASSSourceMapping.ts +32 -32
- package/front_end/models/bindings/StylesSourceMapping.ts +57 -57
- package/front_end/models/bindings/TempFile.ts +34 -34
- package/front_end/models/emulation/DeviceModeModel.ts +208 -203
- package/front_end/models/emulation/EmulatedDevices.ts +34 -34
- package/front_end/panels/console/ConsoleView.ts +2 -1
- package/front_end/panels/console/ConsoleViewMessage.ts +3 -3
- package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +133 -133
- package/front_end/panels/css_overview/CSSOverviewModel.ts +16 -16
- package/front_end/panels/css_overview/CSSOverviewPanel.ts +77 -77
- package/front_end/panels/css_overview/CSSOverviewProcessingView.ts +5 -5
- package/front_end/panels/css_overview/components/CSSOverviewStartView.ts +4 -4
- package/front_end/panels/elements/ElementsTreeElement.ts +6 -10
- package/front_end/panels/elements/ElementsTreeOutline.ts +3 -1
- package/front_end/panels/elements/components/LayoutPane.ts +6 -0
- package/front_end/panels/elements/elementsPanel.css +0 -1
- package/front_end/panels/elements/elementsTreeOutline.css +0 -4
- package/front_end/panels/lighthouse/LighthouseProtocolService.ts +7 -2
- package/front_end/panels/network/BlockedURLsPane.ts +8 -5
- package/front_end/panels/network/blockedURLsPane.css +0 -1
- package/front_end/panels/search/SearchView.ts +0 -2
- package/front_end/panels/sources/BreakpointEditDialog.ts +98 -81
- package/front_end/panels/sources/DebuggerPlugin.ts +15 -14
- package/front_end/ui/components/code_highlighter/CodeHighlighter.ts +18 -2
- package/front_end/ui/components/text_editor/config.ts +6 -0
- package/front_end/ui/components/text_editor/cursor_tooltip.ts +70 -0
- package/front_end/ui/components/text_editor/javascript.ts +590 -0
- package/front_end/ui/components/text_editor/text_editor.ts +1 -0
- package/front_end/ui/components/text_editor/theme.ts +11 -0
- package/front_end/ui/components/tree_outline/TreeOutline.ts +3 -1
- package/front_end/ui/legacy/ARIAUtils.ts +24 -8
- package/front_end/ui/legacy/components/text_editor/cmdevtools.css +1 -0
- package/front_end/ui/legacy/components/text_editor/text_editor-legacy.ts +0 -3
- package/front_end/ui/legacy/components/text_editor/text_editor.ts +0 -2
- package/package.json +1 -1
- package/scripts/migration/class-fields/migrate.js +15 -2
- package/scripts/migration/class-fields/migrate.sh +10 -0
- package/front_end/ui/legacy/components/text_editor/SyntaxHighlighter.ts +0 -62
|
@@ -28,9 +28,6 @@ TextEditor.TextEditorBookMark = TextEditorModule.CodeMirrorTextEditor.TextEditor
|
|
|
28
28
|
/** @constructor */
|
|
29
29
|
TextEditor.CodeMirrorTextEditorFactory = TextEditorModule.CodeMirrorTextEditor.CodeMirrorTextEditorFactory;
|
|
30
30
|
|
|
31
|
-
/** @constructor */
|
|
32
|
-
TextEditor.SyntaxHighlighter = TextEditorModule.SyntaxHighlighter.SyntaxHighlighter;
|
|
33
|
-
|
|
34
31
|
/** @constructor */
|
|
35
32
|
TextEditor.TextEditorAutocompleteController =
|
|
36
33
|
TextEditorModule.TextEditorAutocompleteController.TextEditorAutocompleteController;
|
|
@@ -5,11 +5,9 @@
|
|
|
5
5
|
import './cm_modes.js';
|
|
6
6
|
|
|
7
7
|
import * as CodeMirrorTextEditor from './CodeMirrorTextEditor.js';
|
|
8
|
-
import * as SyntaxHighlighter from './SyntaxHighlighter.js';
|
|
9
8
|
import * as TextEditorAutocompleteController from './TextEditorAutocompleteController.js';
|
|
10
9
|
|
|
11
10
|
export {
|
|
12
11
|
CodeMirrorTextEditor,
|
|
13
|
-
SyntaxHighlighter,
|
|
14
12
|
TextEditorAutocompleteController,
|
|
15
13
|
};
|
package/package.json
CHANGED
|
@@ -44,11 +44,24 @@ for (const file of files) {
|
|
|
44
44
|
continue;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
property.toggleModifier('private', false);
|
|
48
47
|
// https://github.com/dsherret/ts-morph/issues/1198
|
|
49
|
-
|
|
48
|
+
const newName = `SOME_STUPID_PREFIX_${name}`;
|
|
49
|
+
|
|
50
|
+
property.toggleModifier('private', false);
|
|
51
|
+
property.rename(newName, {
|
|
50
52
|
renameInComments: true,
|
|
51
53
|
});
|
|
54
|
+
for (const reference of property.findReferencesAsNodes()) {
|
|
55
|
+
// The first ancestor is the property access on `this.`.
|
|
56
|
+
const containingNode = reference.getAncestors()[1];
|
|
57
|
+
// Replace all `delete this.#somePrivateVariable;` (since that is illegal on private class fields)
|
|
58
|
+
// and replace it with an assignment to `undefined`.
|
|
59
|
+
if (containingNode.getKind() === SyntaxKind.DeleteExpression) {
|
|
60
|
+
console.log(`Replacing delete statement on line ${reference.getStartLineNumber()}`);
|
|
61
|
+
// We should replace the statement, not the expression itself.
|
|
62
|
+
containingNode.getFirstAncestor().replaceWithText(`this.${newName} = undefined;`);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
52
65
|
}
|
|
53
66
|
}
|
|
54
67
|
file.saveSync();
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# This script expects to be called from the root of the repository
|
|
2
|
+
# Example:
|
|
3
|
+
# scripts/migration/class-fields/migrate.sh panels/console
|
|
4
|
+
#
|
|
5
|
+
$PWD/third_party/node/node.py --output scripts/migration/class-fields/migrate.js $1/
|
|
6
|
+
find $PWD/front_end/$1/ -type f -exec sed -i -e 's/SOME_STUPID_PREFIX_/#/g' {} \;
|
|
7
|
+
git cl format --js
|
|
8
|
+
NINJA_SUMMARIZE_BUILD=1 autoninja -C out/Default front_end/$1:bundle
|
|
9
|
+
git add .
|
|
10
|
+
git commit -m "Migrate to private class fields in $1" -m "" -m "R=szuend@chromium.org" -m "" -m "Bug: 1222126"
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
// Copyright 2021 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
|
-
import * as TextUtils from '../../../../models/text_utils/text_utils.js';
|
|
6
|
-
import * as UI from '../../legacy.js';
|
|
7
|
-
|
|
8
|
-
export class SyntaxHighlighter {
|
|
9
|
-
private readonly mimeType: string;
|
|
10
|
-
private readonly stripExtraWhitespace: boolean;
|
|
11
|
-
|
|
12
|
-
constructor(mimeType: string, stripExtraWhitespace: boolean) {
|
|
13
|
-
this.mimeType = mimeType;
|
|
14
|
-
this.stripExtraWhitespace = stripExtraWhitespace;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
createSpan(content: string, className: string): Element {
|
|
18
|
-
const span = document.createElement('span');
|
|
19
|
-
span.className = className.replace(/\S+/g, 'cm-$&');
|
|
20
|
-
if (this.stripExtraWhitespace && className !== 'whitespace') {
|
|
21
|
-
content = content.replace(/^[\n\r]*/, '').replace(/\s*$/, '');
|
|
22
|
-
}
|
|
23
|
-
UI.UIUtils.createTextChild(span, content);
|
|
24
|
-
return span;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
syntaxHighlightNode(node: Element): Promise<void> {
|
|
28
|
-
const lines = node.textContent ? node.textContent.split('\n') : [];
|
|
29
|
-
let plainTextStart: number;
|
|
30
|
-
let line: string;
|
|
31
|
-
|
|
32
|
-
node.removeChildren();
|
|
33
|
-
const tokenize = TextUtils.CodeMirrorUtils.TokenizerFactory.instance().createTokenizer(this.mimeType);
|
|
34
|
-
for (let i = 0; i < lines.length; ++i) {
|
|
35
|
-
line = lines[i];
|
|
36
|
-
plainTextStart = 0;
|
|
37
|
-
tokenize(line, processToken.bind(this));
|
|
38
|
-
if (plainTextStart < line.length) {
|
|
39
|
-
const plainText = line.substring(plainTextStart, line.length);
|
|
40
|
-
UI.UIUtils.createTextChild(node, plainText);
|
|
41
|
-
}
|
|
42
|
-
if (i < lines.length - 1) {
|
|
43
|
-
UI.UIUtils.createTextChild(node, '\n');
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
return Promise.resolve();
|
|
47
|
-
|
|
48
|
-
function processToken(
|
|
49
|
-
this: SyntaxHighlighter, token: string, tokenType: string|null, column: number, newColumn: number): void {
|
|
50
|
-
if (!tokenType) {
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
if (column > plainTextStart) {
|
|
55
|
-
const plainText = line.substring(plainTextStart, column);
|
|
56
|
-
UI.UIUtils.createTextChild(node, plainText);
|
|
57
|
-
}
|
|
58
|
-
node.appendChild(this.createSpan(token, tokenType));
|
|
59
|
-
plainTextStart = newColumn;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|