chrome-devtools-frontend 1.0.1651641 → 1.0.1654411
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/.agents/skills/fixing-skipped-tests/SKILL.md +32 -0
- package/.agents/skills/migrate-chromium-test/SKILL.md +144 -0
- package/docs/get_the_code.md +1 -2
- package/docs/ui_engineering.md +3 -1
- package/eslint.config.mjs +0 -5
- package/front_end/core/sdk/CPUThrottlingManager.ts +13 -8
- package/front_end/core/sdk/CSSMetadata.ts +23 -0
- package/front_end/core/sdk/CompilerSourceMappingContentProvider.ts +8 -4
- package/front_end/core/sdk/DOMModel.ts +4 -0
- package/front_end/core/sdk/EmulationModel.ts +4 -0
- package/front_end/core/sdk/ResourceTreeModel.ts +3 -2
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +459 -74
- package/front_end/entrypoints/main/MainImpl.ts +0 -6
- package/front_end/foundation/Universe.ts +18 -0
- package/front_end/generated/InspectorBackendCommands.ts +7 -6
- package/front_end/generated/SupportedCSSProperties.js +208 -34
- package/front_end/generated/protocol.ts +64 -7
- package/front_end/models/ai_assistance/AiAgent2.ts +3 -3
- package/front_end/models/ai_assistance/AiConversation.ts +2 -1
- package/front_end/models/ai_assistance/README.md +5 -4
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +1 -1
- package/front_end/models/ai_assistance/agents/PerformanceAgent.snapshot.txt +2 -2
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +11 -164
- package/front_end/models/ai_assistance/ai_assistance.ts +6 -2
- package/front_end/models/ai_assistance/contexts/PerformanceTraceContext.ts +295 -0
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.snapshot.txt +10 -10
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.ts +12 -11
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +6 -6
- package/front_end/models/ai_assistance/skills/accessibility.md +4 -2
- package/front_end/models/ai_assistance/tools/GetElementAccessibilityDetails.ts +142 -0
- package/front_end/models/ai_assistance/tools/GetStyles.ts +1 -1
- package/front_end/models/ai_assistance/tools/README.md +22 -2
- package/front_end/models/ai_assistance/tools/{ResolveLighthousePath.ts → ResolveDevtoolsNodePath.ts} +18 -17
- package/front_end/models/ai_assistance/tools/Tool.ts +7 -2
- package/front_end/models/ai_assistance/tools/ToolRegistry.ts +10 -8
- package/front_end/models/autofill_manager/AutofillManager.ts +7 -15
- package/front_end/models/bindings/NetworkProject.ts +4 -8
- package/front_end/models/breakpoints/BreakpointManager.ts +9 -9
- package/front_end/models/emulation/DeviceModeModel.ts +24 -0
- package/front_end/models/emulation/EmulatedDevices.ts +108 -0
- package/front_end/models/heap_snapshot/HeapSnapshotModel.ts +36 -0
- package/front_end/models/heap_snapshot/HeapSnapshotProxy.ts +8 -0
- package/front_end/models/issues_manager/IssuesManager.ts +10 -6
- package/front_end/models/javascript_metadata/JavaScriptMetadata.ts +4 -5
- package/front_end/models/live-metrics/LiveMetrics.ts +6 -6
- package/front_end/models/live-metrics/web-vitals-injected/spec/spec.ts +5 -5
- package/front_end/models/live-metrics/web-vitals-injected/web-vitals-injected.ts +3 -3
- package/front_end/models/logs/LogManager.ts +25 -10
- package/front_end/models/logs/NetworkLog.ts +24 -19
- package/front_end/models/persistence/AutomaticFileSystemWorkspaceBinding.ts +14 -5
- package/front_end/models/persistence/IsolatedFileSystem.ts +9 -11
- package/front_end/models/persistence/IsolatedFileSystemManager.ts +5 -3
- package/front_end/models/persistence/NetworkPersistenceManager.ts +73 -44
- package/front_end/models/persistence/PersistenceImpl.ts +4 -5
- package/front_end/models/trace/EntityMapper.ts +1 -1
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +9 -9
- package/front_end/panels/ai_assistance/ExportConversation.ts +4 -1
- package/front_end/panels/ai_assistance/components/ChatInput.ts +2 -2
- package/front_end/panels/application/IndexedDBViews.ts +38 -36
- package/front_end/panels/application/components/AdsView.ts +4 -0
- package/front_end/panels/autofill/AutofillView.ts +1 -1
- package/front_end/panels/autofill/autofill-meta.ts +3 -2
- package/front_end/panels/elements/AccessibilityTreeUtils.ts +26 -15
- package/front_end/panels/elements/AccessibilityTreeView.ts +12 -9
- package/front_end/panels/elements/ElementsTreeOutline.ts +5 -0
- package/front_end/panels/layer_viewer/LayerTreeOutline.ts +118 -68
- package/front_end/panels/layer_viewer/Layers3DView.ts +1 -1
- package/front_end/panels/layer_viewer/layerTreeOutline.css +20 -13
- package/front_end/panels/layers/LayersPanel.ts +1 -1
- package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +64 -17
- package/front_end/panels/mobile_throttling/throttlingSettingsTab.css +5 -0
- package/front_end/panels/network/LinkPreloadGenerator.ts +101 -0
- package/front_end/panels/network/NetworkLogView.ts +28 -0
- package/front_end/panels/network/network.ts +2 -0
- package/front_end/panels/profiler/HeapSnapshotView.ts +121 -33
- package/front_end/panels/profiler/ModuleUIStrings.ts +4 -0
- package/front_end/panels/sources/ScopeChainSidebarPane.ts +0 -12
- package/front_end/panels/timeline/TimelineHistoryManager.ts +38 -37
- package/front_end/panels/timeline/TimelinePanel.ts +32 -8
- package/front_end/panels/timeline/components/CPUThrottlingSelector.ts +7 -6
- package/front_end/panels/timeline/components/LiveMetricsView.ts +38 -38
- package/front_end/panels/timeline/components/MetricCard.ts +18 -18
- package/front_end/panels/timeline/components/liveMetricsView.css +6 -6
- package/front_end/panels/timeline/components/metricCard.css +4 -4
- package/front_end/panels/whats_new/ReleaseNoteText.ts +3 -3
- package/front_end/panels/whats_new/resources/WNDT.md +1 -1
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/ui/legacy/InspectorDrawerView.ts +7 -5
- package/front_end/ui/legacy/ListWidget.ts +12 -0
- package/front_end/ui/legacy/SplitWidget.ts +12 -11
- package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +23 -19
- package/front_end/ui/legacy/components/object_ui/CustomPreviewComponent.ts +8 -1
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +110 -17
- package/front_end/ui/legacy/treeoutline.css +1 -1
- package/front_end/ui/visual_logging/KnownContextValues.ts +1 -0
- package/package.json +4 -3
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: fixing-skipped-tests
|
|
3
|
+
description: Use this skill when unskipping a test that was previously skipped.
|
|
4
|
+
---
|
|
5
|
+
# Fixing Skipped Tests
|
|
6
|
+
|
|
7
|
+
This skill outlines the workflow for fixing skipped tests in the DevTools codebase, typically given a Chromium bug link (e.g., `crbug.com/1234567`).
|
|
8
|
+
|
|
9
|
+
## Workflow
|
|
10
|
+
|
|
11
|
+
1. **Extract the Bug ID**
|
|
12
|
+
- The input is typically a bug link like `crbug.com/<bugid>`. Extract the `<bugid>` from the link.
|
|
13
|
+
|
|
14
|
+
2. **Create a Branch**
|
|
15
|
+
- Create a new branch named `fixed-<bugid>`.
|
|
16
|
+
- Ensure you use the instructions from the `devtools-version-control` skill to create and switch branches appropriately.
|
|
17
|
+
|
|
18
|
+
3. **Search for the Skipped Tests**
|
|
19
|
+
- Search the codebase for the `<bugid>` to find skipped tests.
|
|
20
|
+
- You should look for occurrences like `it.skip('[crbug.com/<bugid>] ...', ...)` or skipped describes that mention the bug ID.
|
|
21
|
+
|
|
22
|
+
4. **Iterative Fix Process**
|
|
23
|
+
- **Step 1:** Change `it.skip` or `describe.skip` to `it.only` or `describe.only` for *one* of the tests associated with the bug, so that only that specific test runs.
|
|
24
|
+
- **Step 2:** Re-run the tests (e.g., `npm run test -- <path_to_test_file>`) using the guidelines from the `devtools-verification` skill. If you are dealing with flaky tests, you can use the `--repeat=x` flag (e.g. `npm run test -- <path_to_test_file> --repeat=20`) to run the test multiple times to reproduce the flakiness.
|
|
25
|
+
- **Step 3:** Analyze the test failure and make the necessary fixes to the code or the test itself.
|
|
26
|
+
- **Step 4:** Re-run the test to ensure the fix is correct. Remove `.only`.
|
|
27
|
+
- **Step 5:** Remove the `[crbug.com/<bugid>]` prefix from the test name string if it is present.
|
|
28
|
+
- **Step 6:** Remove any comments directly above the test that explain the reason why the test was skipped (e.g., `// TODO(crbug...): Flaky`).
|
|
29
|
+
- **Step 7:** Apply the fix to the remaining tests, un-skipping them one by one or in batches, and verifying until all are passing.
|
|
30
|
+
|
|
31
|
+
5. **Verify Full Build**
|
|
32
|
+
- Before finishing, run the full verification process (TypeScript checks, linters, full test run) as required by the repository best practices.
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: devtools-migrate-chromium-test
|
|
3
|
+
description: Use when migrating chromium `third_party/blink/web_tests/http/tests/devtools/` tests to modern unit tests in `third_party/devtools-frontend/src/front_end/`.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Migrating Legacy DevTools Tests
|
|
7
|
+
|
|
8
|
+
The skill should be used from within a Chromium check out. The agent should make a devtools CL for the changes in `third_party/devtools-frontend`.
|
|
9
|
+
|
|
10
|
+
## Workflow
|
|
11
|
+
|
|
12
|
+
1. **Identify the Test to Move**:
|
|
13
|
+
|
|
14
|
+
- Locate the legacy test file (usually `.js`) and its expectation file (`-expected.txt`) in `third_party/blink/web_tests/http/tests/devtools/`.
|
|
15
|
+
- Example: `unit/datagrid-editable-longtext.js`
|
|
16
|
+
|
|
17
|
+
2. **Identify the Target Location**:
|
|
18
|
+
|
|
19
|
+
- Find the file being tested in `third_party/devtools-frontend/src/front_end/`.
|
|
20
|
+
- Place the new test file next to the file being tested, following the naming convention `[FileName].test.ts`.
|
|
21
|
+
- Example: If testing `ui/legacy/components/data_grid/DataGrid.ts`, the test should be `ui/legacy/components/data_grid/DataGrid.test.ts`.
|
|
22
|
+
|
|
23
|
+
3. **Convert the Test Content**:
|
|
24
|
+
|
|
25
|
+
- Rewrite the test from the legacy `TestRunner` style to the modern Mocha/Chai style used in DevTools.
|
|
26
|
+
- Use `describeWithEnvironment` or `describe` as appropriate.
|
|
27
|
+
- Replace `TestRunner.addResult` and expectation comparisons with standard assertions (`assert.strictEqual`, `assert.isTrue`, etc.).
|
|
28
|
+
- If the test requires rendering, use `renderElementIntoDOM` to attach elements to a test container.
|
|
29
|
+
- If testing legacy components that require internal tokens or have private methods, try to use public APIs or events instead. If impossible, consider using structural typing workarounds or updating the component to be more testable.
|
|
30
|
+
- If tests require a repetitive setup extract it into a test helper function at the top of the file.
|
|
31
|
+
|
|
32
|
+
4. **Update BUILD.gn**:
|
|
33
|
+
|
|
34
|
+
- Add the new test file to the `sources` list of the `devtools_ui_module("unittests")` or `devtools_foundation_module("foundation_unittests")` target in the corresponding `BUILD.gn` file.
|
|
35
|
+
|
|
36
|
+
5. **Verify the Changes**:
|
|
37
|
+
|
|
38
|
+
- Build the unittests target: `autoninja -C out/Default <target_path>:unittests`
|
|
39
|
+
- Run the test using the DevTools test runner: `npm run test -- <relative_path_to_test>`
|
|
40
|
+
- Ensure the test passes.
|
|
41
|
+
|
|
42
|
+
6. **Clean Up**:
|
|
43
|
+
|
|
44
|
+
- Delete the original legacy test file and its expectation file from `third_party/blink/web_tests/...`.
|
|
45
|
+
- _(Optional)_ If instructed by the user, you may leave the files or handle them differently.
|
|
46
|
+
|
|
47
|
+
## Example Conversion
|
|
48
|
+
|
|
49
|
+
### Legacy Test (`datagrid-editable-longtext.js`)
|
|
50
|
+
|
|
51
|
+
```javascript
|
|
52
|
+
import { TestRunner } from 'test_runner';
|
|
53
|
+
import * as DataGrid from 'devtools/ui/legacy/components/data_grid/data_grid.js';
|
|
54
|
+
|
|
55
|
+
(async function () {
|
|
56
|
+
TestRunner.addResult('This tests long text in datagrid.');
|
|
57
|
+
// ... setup grid ...
|
|
58
|
+
TestRunner.addResult('Original lengths');
|
|
59
|
+
// ... dump results ...
|
|
60
|
+
TestRunner.completeTest();
|
|
61
|
+
})();
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Converted Test (`DataGrid.test.ts`)
|
|
65
|
+
|
|
66
|
+
```typescript
|
|
67
|
+
import * as DataGrid from './data_grid.js';
|
|
68
|
+
import { renderElementIntoDOM } from '../../../../testing/DOMHelpers.js';
|
|
69
|
+
import { describeWithEnvironment } from '../../../../testing/EnvironmentHelpers.js';
|
|
70
|
+
|
|
71
|
+
describeWithEnvironment('DataGrid', () => {
|
|
72
|
+
it('tests long text in datagrid', () => {
|
|
73
|
+
// ... setup grid ...
|
|
74
|
+
// Use assertions instead of printing results
|
|
75
|
+
assert.strictEqual(keyElement.textContent.length, 1500);
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Tips & Troubleshooting
|
|
81
|
+
|
|
82
|
+
- **TypeScript Type Mismatches**: Legacy tests often use plain strings for properties that now require specific branded types like `LocalizedString`. You can often bypass this in tests by casting the object array `as DataGrid.DataGrid.ColumnDescriptor[]` or similar, or by using `i18n.i18n.lockedString` if appropriate.
|
|
83
|
+
- **Accessing Private Methods**: Legacy tests frequently called private methods (e.g., `dataGrid.update()`). In TypeScript unit tests, you should avoid this. Look for public alternatives (e.g., `updateInstantly()`) or trigger the behavior by dispatching standard DOM events (e.g., `element.dispatchEvent(new Event('scroll'))` instead of calling `onScroll()`).
|
|
84
|
+
- **Recursive Expansion Limits**: Methods like `TreeElement.expandRecursively()` have a default depth limit (e.g., 3) to prevent infinite loops. If your test requires expanding deeper trees, remember to pass a higher max depth argument: `expandRecursively(10)`.
|
|
85
|
+
- **Mocking Objects**: When testing UI components that display objects (like `RemoteObject`), look for existing mock helpers in related test files (e.g., `createDeepRemoteObjectMock` in `ObjectPropertiesSection.test.ts`) instead of trying to create real SDK objects or complex mocks from scratch. Other helpers live inside `front_end/testing`.
|
|
86
|
+
- **Ignoring Environment Failures**: In some environments, `npm run test` may exit with code 1 due to memory leaks (e.g., `WebFrame LEAKED`) or infrastructure issues (e.g., `gpkg` or `Corp Airlock` logs), even if the tests themselves passed. Always check the end of the test log for `TOTAL: X SUCCESS` to confirm if the test logic was successful.
|
|
87
|
+
- **Rendering issue**: If you encounter an issue where checking values never gives correct information it may be due to async rendering. To resolve that you may trying using `raf()` from `front_end/testing/DOMHelpers.ts` to wait for the next rendering cycle.
|
|
88
|
+
|
|
89
|
+
## Creating a DevTools CL from a Chromium Checkout
|
|
90
|
+
|
|
91
|
+
To create a DevTools Change List (CL) from a Chromium checkout, you'll be working within the devtools-frontend repository, which is located inside your Chromium source tree. The depot_tools package (which includes git cl) must be in your PATH.
|
|
92
|
+
|
|
93
|
+
Here's the typical workflow:
|
|
94
|
+
|
|
95
|
+
1. **Navigate to the DevTools Frontend Directory**:
|
|
96
|
+
The DevTools frontend code resides in `third_party/devtools-frontend/src/` within your Chromium checkout (`chromium/src`).
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
cd path/to/chromium/src/third_party/devtools-frontend/src/
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
2. **Create a New Branch**:
|
|
103
|
+
It's best practice to create a new branch for your changes:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
git new-branch my-devtools-feature
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
(Or use `git checkout -b my-devtools-feature`)
|
|
110
|
+
|
|
111
|
+
3. **Make Your Code Changes**:
|
|
112
|
+
Edit the files as needed for your feature or bug fix.
|
|
113
|
+
|
|
114
|
+
4. **Commit Changes Locally**:
|
|
115
|
+
Stage and commit your changes using standard Git commands:
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
git add .
|
|
119
|
+
git commit -m "My DevTools feature description"
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
_See the Chromium guide on commit messages for best practices on formatting descriptions, including the use of tags like Bug:. _
|
|
123
|
+
|
|
124
|
+
5. **Upload the CL for Review**:
|
|
125
|
+
Use `git cl upload` to send your changes to the Chromium Gerrit code review system:
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
git cl upload
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
This command will create a CL on `https://chromium-review.googlesource.com`. Follow the prompts to add a description, reviewers, etc. You can also add reviewers and trigger builds through the Gerrit web UI.
|
|
132
|
+
|
|
133
|
+
6. **Code Review Process**:
|
|
134
|
+
Your CL will be reviewed by DevTools owners. You may need to address feedback by amending your commit and uploading new patch sets using `git cl upload` again. Once approved, you can land the change via the Commit Queue (CQ).
|
|
135
|
+
|
|
136
|
+
### Working on Changes Across DevTools and Chromium Core
|
|
137
|
+
|
|
138
|
+
- DevTools frontend (`third_party/devtools-frontend/src/`) and the main Chromium codebase (`chromium/src`) are distinct Git repositories.
|
|
139
|
+
- If your work involves changes in both areas, you generally need to create separate CLs: one within the devtools-frontend repo and one within the main `chromium/src` repo.
|
|
140
|
+
- The "Juggling the git submodules" section of the DevTools documentation provides guidance on managing these cross-repository changes.
|
|
141
|
+
|
|
142
|
+
## After finishing the migration
|
|
143
|
+
|
|
144
|
+
Identify any helping tips that you discovered during the migration and add them to this skill.
|
package/docs/get_the_code.md
CHANGED
|
@@ -56,8 +56,7 @@ out of bundling by setting `devtools_bundle` to `false`
|
|
|
56
56
|
gn gen out/fast-build --args="devtools_skip_typecheck=true devtools_bundle=false"
|
|
57
57
|
```
|
|
58
58
|
|
|
59
|
-
and use `npm run build -- -t fast-build` to build this target
|
|
60
|
-
also just change the `Default` target to skip bundling and type checking).
|
|
59
|
+
and use `npm run build -- -t fast-build` to build this target.
|
|
61
60
|
|
|
62
61
|
### Rebuilding automatically
|
|
63
62
|
|
package/docs/ui_engineering.md
CHANGED
|
@@ -209,7 +209,9 @@ assert.deepStrictEqual((await viewCall).headersForSourceURL, [{...}]);
|
|
|
209
209
|
|
|
210
210
|
// ❌ not recommended: mocking CDP responses to make the models behave in a certain way
|
|
211
211
|
// while testing a presenter is fragile.
|
|
212
|
-
|
|
212
|
+
const connection = new MockCDPConnection();
|
|
213
|
+
connection.setSuccessHandler('CSS.getHeaders', () => ({}));
|
|
214
|
+
createTarget({connection});
|
|
213
215
|
const presenter = new Presenter();
|
|
214
216
|
presenter.doSomething();
|
|
215
217
|
```
|
package/eslint.config.mjs
CHANGED
|
@@ -775,11 +775,6 @@ export default defineConfig([
|
|
|
775
775
|
|
|
776
776
|
settings: {
|
|
777
777
|
'mocha/additionalCustomNames': [
|
|
778
|
-
{
|
|
779
|
-
name: 'describeWithDevtoolsExtension',
|
|
780
|
-
type: 'suite',
|
|
781
|
-
interfaces: ['BDD', 'TDD'],
|
|
782
|
-
},
|
|
783
778
|
{
|
|
784
779
|
name: 'describeWithEnvironment',
|
|
785
780
|
type: 'suite',
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Common from '../../core/common/common.js';
|
|
6
6
|
import * as i18n from '../i18n/i18n.js';
|
|
7
|
+
import * as Root from '../root/root.js';
|
|
7
8
|
|
|
8
9
|
import {EmulationModel} from './EmulationModel.js';
|
|
9
10
|
import {type SDKModelObserver, TargetManager} from './TargetManager.js';
|
|
@@ -35,8 +36,6 @@ const str_ = i18n.i18n.registerUIStrings('core/sdk/CPUThrottlingManager.ts', UIS
|
|
|
35
36
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
36
37
|
const i18nLazyString = i18n.i18n.getLazilyComputedLocalizedString.bind(undefined, str_);
|
|
37
38
|
|
|
38
|
-
let throttlingManagerInstance: CPUThrottlingManager|undefined;
|
|
39
|
-
|
|
40
39
|
export class CPUThrottlingManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes> implements
|
|
41
40
|
SDKModelObserver<EmulationModel> {
|
|
42
41
|
readonly #targetManager: TargetManager;
|
|
@@ -55,18 +54,24 @@ export class CPUThrottlingManager extends Common.ObjectWrapper.ObjectWrapper<Eve
|
|
|
55
54
|
targetManager.observeModels(EmulationModel, this);
|
|
56
55
|
}
|
|
57
56
|
|
|
58
|
-
static instance(opts: {
|
|
57
|
+
static instance(opts: {
|
|
58
|
+
forceNew?: boolean|null,
|
|
59
|
+
settings?: Common.Settings.Settings,
|
|
60
|
+
targetManager?: TargetManager,
|
|
61
|
+
} = {forceNew: null}): CPUThrottlingManager {
|
|
59
62
|
const {forceNew} = opts;
|
|
60
|
-
if (!
|
|
61
|
-
|
|
62
|
-
|
|
63
|
+
if (!Root.DevToolsContext.globalInstance().has(CPUThrottlingManager) || forceNew) {
|
|
64
|
+
Root.DevToolsContext.globalInstance().set(
|
|
65
|
+
CPUThrottlingManager,
|
|
66
|
+
new CPUThrottlingManager(opts.settings ?? Common.Settings.Settings.instance(),
|
|
67
|
+
opts.targetManager ?? TargetManager.instance()));
|
|
63
68
|
}
|
|
64
69
|
|
|
65
|
-
return
|
|
70
|
+
return Root.DevToolsContext.globalInstance().get(CPUThrottlingManager);
|
|
66
71
|
}
|
|
67
72
|
|
|
68
73
|
static removeInstance(): void {
|
|
69
|
-
|
|
74
|
+
Root.DevToolsContext.globalInstance().delete(CPUThrottlingManager);
|
|
70
75
|
}
|
|
71
76
|
|
|
72
77
|
cpuThrottlingRate(): number {
|
|
@@ -108,6 +108,29 @@ export class CSSMetadata {
|
|
|
108
108
|
propertyValueSets.set(propertyName, extraValues);
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
|
+
// and add common keywords for shorthands
|
|
112
|
+
const commonKeywordSet = new Set(CommonKeywords);
|
|
113
|
+
for (const propertyName of this.#longhands.keys()) {
|
|
114
|
+
// skip "all" because it is a CSS-wide keyword
|
|
115
|
+
// skip shorthands that are defined in generatedPropertyValues because they have their own value sets
|
|
116
|
+
if (propertyName === 'all' || propertyValueSets.has(propertyName)) {
|
|
117
|
+
continue;
|
|
118
|
+
}
|
|
119
|
+
const longhands = this.#longhands.get(propertyName);
|
|
120
|
+
if (!longhands) {
|
|
121
|
+
continue;
|
|
122
|
+
}
|
|
123
|
+
const values = new Array<string>();
|
|
124
|
+
for (const longhand of longhands) {
|
|
125
|
+
const longhandValues = propertyValueSets.get(longhand);
|
|
126
|
+
if (!longhandValues) {
|
|
127
|
+
continue;
|
|
128
|
+
}
|
|
129
|
+
const commonKeywordsInLonghandValues = longhandValues.intersection(commonKeywordSet);
|
|
130
|
+
values.push(...commonKeywordsInLonghandValues);
|
|
131
|
+
}
|
|
132
|
+
propertyValueSets.set(propertyName, new Set(values));
|
|
133
|
+
}
|
|
111
134
|
// finally add keywords from alias property, common keywords to value sets and convert property #values
|
|
112
135
|
// into arrays since callers expect arrays
|
|
113
136
|
for (const [propertyName, values] of propertyValueSets) {
|
|
@@ -25,13 +25,17 @@ export class CompilerSourceMappingContentProvider implements TextUtils.ContentPr
|
|
|
25
25
|
readonly #sourceURL: Platform.DevToolsPath.UrlString;
|
|
26
26
|
readonly #contentType: Common.ResourceType.ResourceType;
|
|
27
27
|
readonly #initiator: PageResourceLoadInitiator;
|
|
28
|
+
readonly #pageResourceLoader: PageResourceLoader;
|
|
28
29
|
|
|
29
|
-
constructor(
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
constructor(sourceURL: Platform.DevToolsPath.UrlString, contentType: Common.ResourceType.ResourceType,
|
|
31
|
+
initiator: PageResourceLoadInitiator,
|
|
32
|
+
pageResourceLoader: PageResourceLoader = initiator.target ?
|
|
33
|
+
initiator.target.targetManager().context.get(PageResourceLoader) :
|
|
34
|
+
PageResourceLoader.instance()) {
|
|
32
35
|
this.#sourceURL = sourceURL;
|
|
33
36
|
this.#contentType = contentType;
|
|
34
37
|
this.#initiator = initiator;
|
|
38
|
+
this.#pageResourceLoader = pageResourceLoader;
|
|
35
39
|
}
|
|
36
40
|
|
|
37
41
|
contentURL(): Platform.DevToolsPath.UrlString {
|
|
@@ -44,7 +48,7 @@ export class CompilerSourceMappingContentProvider implements TextUtils.ContentPr
|
|
|
44
48
|
|
|
45
49
|
async requestContentData(): Promise<TextUtils.ContentData.ContentDataOrError> {
|
|
46
50
|
try {
|
|
47
|
-
const {content} = await
|
|
51
|
+
const {content} = await this.#pageResourceLoader.loadResource(this.#sourceURL, this.#initiator);
|
|
48
52
|
return new TextUtils.ContentData.ContentData(
|
|
49
53
|
content, /* isBase64=*/ false, this.#contentType.canonicalMimeType());
|
|
50
54
|
} catch (e) {
|
|
@@ -512,6 +512,10 @@ export class DOMNode extends Common.ObjectWrapper.ObjectWrapper<DOMNodeEventType
|
|
|
512
512
|
return this.#pseudoElements.get(Protocol.DOM.PseudoType.PickerIcon)?.at(-1);
|
|
513
513
|
}
|
|
514
514
|
|
|
515
|
+
interestButtonPseudoElement(): DOMNode|undefined {
|
|
516
|
+
return this.#pseudoElements.get(Protocol.DOM.PseudoType.InterestButton)?.at(-1);
|
|
517
|
+
}
|
|
518
|
+
|
|
515
519
|
markerPseudoElement(): DOMNode|undefined {
|
|
516
520
|
return this.#pseudoElements.get(Protocol.DOM.PseudoType.Marker)?.at(-1);
|
|
517
521
|
}
|
|
@@ -250,6 +250,10 @@ export class EmulationModel extends SDKModel<EmulationModelEventTypes> implement
|
|
|
250
250
|
}
|
|
251
251
|
}
|
|
252
252
|
|
|
253
|
+
async setSafeAreaInsets(insets: Protocol.Emulation.SafeAreaInsets): Promise<void> {
|
|
254
|
+
await this.#emulationAgent.invoke_setSafeAreaInsetsOverride({insets});
|
|
255
|
+
}
|
|
256
|
+
|
|
253
257
|
overlayModel(): OverlayModel|null {
|
|
254
258
|
return this.#overlayModel;
|
|
255
259
|
}
|
|
@@ -92,8 +92,9 @@ export class ResourceTreeModel extends SDKModel<EventTypes> {
|
|
|
92
92
|
return null;
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
static reloadAllPages(bypassCache?: boolean, scriptToEvaluateOnLoad?: string
|
|
96
|
-
|
|
95
|
+
static reloadAllPages(bypassCache?: boolean, scriptToEvaluateOnLoad?: string,
|
|
96
|
+
targetManager: TargetManager = TargetManager.instance()): void {
|
|
97
|
+
for (const resourceTreeModel of targetManager.models(ResourceTreeModel)) {
|
|
97
98
|
if (resourceTreeModel.target().parentTarget()?.type() !== Type.FRAME) {
|
|
98
99
|
resourceTreeModel.reloadPage(bypassCache, scriptToEvaluateOnLoad);
|
|
99
100
|
}
|