chrome-devtools-frontend 1.0.1520535 → 1.0.1521746
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/docs/checklist/README.md +80 -27
- package/front_end/core/host/InspectorFrontendHost.ts +3 -0
- package/front_end/core/root/Runtime.ts +5 -0
- package/front_end/core/sdk/CSSModel.ts +8 -0
- package/front_end/core/sdk/CSSRule.ts +4 -0
- package/front_end/core/sdk/CSSStartingStyle.ts +29 -0
- package/front_end/core/sdk/DOMModel.ts +24 -1
- package/front_end/core/sdk/RehydratingConnection.snapshot.txt +209 -209
- package/front_end/core/sdk/RehydratingConnection.ts +5 -2
- package/front_end/core/sdk/sdk.ts +2 -0
- package/front_end/entrypoints/rehydrated_devtools_app/rehydrated_devtools_app.ts +1 -0
- package/front_end/models/trace/handlers/ScriptsHandler.ts +2 -1
- package/front_end/models/trace/insights/LegacyJavaScript.ts +2 -1
- package/front_end/panels/elements/ComputedStyleModel.ts +2 -1
- package/front_end/panels/elements/ElementsTreeElement.ts +47 -0
- package/front_end/panels/elements/ElementsTreeOutline.ts +13 -0
- package/front_end/panels/elements/StylePropertiesSection.ts +16 -0
- package/front_end/panels/elements/components/AdornerManager.ts +7 -0
- package/front_end/panels/settings/components/SyncSection.ts +4 -16
- package/front_end/ui/legacy/InspectorView.ts +22 -15
- package/front_end/ui/visual_logging/KnownContextValues.ts +1 -0
- package/package.json +1 -1
package/docs/checklist/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Chromium DevTools support checklist (for Blink Intents)
|
1
|
+
# Chromium DevTools support checklist (for [Blink Intents](https://developer.chrome.com/docs/web-platform/blink-intents))
|
2
2
|
|
3
3
|
[goo.gle/devtools-checklist](https://goo.gle/devtools-checklist)
|
4
4
|
|
@@ -6,20 +6,28 @@
|
|
6
6
|
|
7
7
|
Many new Web Platform Features (WPFs) can piggyback off of DevTools' general tooling for HTML, DOM, CSS, JavaScript,
|
8
8
|
WebAssembly, Network, and other aspects — requiring only minimal or no changes to make DevTools behave as expected
|
9
|
-
in light of the new WPF. This document refers to such cases as _basic
|
9
|
+
in light of the new WPF. This document refers to such cases as _basic support_.
|
10
10
|
|
11
11
|
However, some WPFs might warrant larger changes, including brand-new DevTools features. This document refers to such
|
12
|
-
cases as _extended
|
12
|
+
cases as _extended support_.
|
13
|
+
|
14
|
+
**What is basic support?**
|
15
|
+
Basic support ensures that a new WPF is introspectable and DevTools does not break or crash Chromium in its presence. In addition, developers should have a way of knowing if their web application uses this WPF correctly. Definitions and examples of basic support for common WPF categories can be found below.
|
16
|
+
|
17
|
+
**What is extended support?**
|
18
|
+
Extended support involves dedicated, custom tooling to reduce friction and ensure the adoption of a new Web Platform Feature. It is considered on a case-by-case basis, typically for WPFs that are particularly complex and/or expected to be very popular. Examples include a custom UI editor for a new CSS feature (e.g. the flexbox editor) or dedicated debugging support in the Network panel for a new protocol (e.g. WebSocket).
|
19
|
+
|
20
|
+
Extended support is not a requirement for shipping a WPF. If you believe your feature requires extended support, please refer to the [guidelines for working with the DevTools team](../playbook.md) to start the discussion.
|
13
21
|
|
14
22
|
It’s the WPF owner’s responsibility to ensure the tooling story is thought through, by answering the question:
|
15
23
|
_"how would a web developer making use of your new WPF test and debug their code?"_
|
16
24
|
|
17
|
-
- Basic
|
18
|
-
- Extended
|
25
|
+
- Basic support must be implemented before shipping a new WPF.
|
26
|
+
- Extended support must be considered on a case-by-case basis, and is not tightly bound to or blocking a WPF's shipping.
|
19
27
|
|
20
|
-
|
28
|
+
The following sections capture examples of different kinds of WPFs, the tooling support they require, and how this can be achieved.
|
21
29
|
|
22
|
-
***
|
30
|
+
***
|
23
31
|
**IMPORTANT:** Please take a look at the [DevTools UI feature checklist](./ui.md) prior
|
24
32
|
to changing or extending the DevTools user interface (UI).
|
25
33
|
***
|
@@ -36,27 +44,35 @@ See the [Chromium DevTools support checklist for JavaScript language features](h
|
|
36
44
|
See the [Chromium DevTools checklist for WebAssembly features](https://goo.gle/devtools-wasm-checklist).
|
37
45
|
|
38
46
|
|
39
|
-
##
|
47
|
+
## DOM, HTML, and Web APIs
|
48
|
+
|
49
|
+
### New HTML elements
|
50
|
+
|
51
|
+
> **Basic support requirement:** The new element is displayed in the DOM tree with the correct tag name and structure, and both the element and its attributes are editable.
|
52
|
+
|
53
|
+
This is often automatically supported because the Elements panel directly reflects the browser's internal DOM representation; any element that the browser can parse and add to the DOM will therefore appear in the tree. Verify that inspecting the new element in the Elements tab looks alright and works as expected (typically, this requires no additional implementation effort).
|
40
54
|
|
41
|
-
New
|
42
|
-
in the Elements tab looks alright and works as expected (typically, this requires no additional implementation effort).
|
55
|
+
### New WebIDL/DOM interfaces and attributes
|
43
56
|
|
57
|
+
> **Basic support requirement:** New interfaces, attributes, and methods are accessible as properties on their corresponding DOM objects in the Console and appear in autocomplete suggestions.
|
44
58
|
|
45
|
-
|
59
|
+
This is often automatically supported because the DevTools Console has access to the same JavaScript runtime as the page. Any property that is programmatically accessible on a DOM object will be discoverable by the Console's autocomplete mechanism.
|
46
60
|
|
47
|
-
Verify that the new properties show up in the DevTools Console autocomplete functionality
|
48
|
-
To enable argument hints for new or changed parameterized functions, run
|
61
|
+
Verify that the new properties show up in the DevTools Console autocomplete functionality. To enable argument hints for new or changed parameterized functions, run
|
49
62
|
```bash
|
50
63
|
devtools-frontend/src/scripts/deps/roll_deps.py
|
51
64
|
```
|
52
|
-
to re-generate `devtools-frontend/src/front_end/models/javascript\_metadata/NativeFunctions.js` ([Example CL](http://crrev.com/c/3432787)).
|
65
|
+
to re-generate `devtools-frontend/src/front_end/models/javascript\_metadata/NativeFunctions.js` ([Example CL](http://crrev.com/c/3432787)). For more details, see the [Chromium DevTools support checklist for JavaScript language features](https://goo.gle/v8-checklist).
|
53
66
|
|
54
67
|

|
55
68
|
|
69
|
+
### New DOM events
|
56
70
|
|
57
|
-
|
71
|
+
> **Basic support requirement:** The new DOM event is discoverable. This means it must (1) appear in the **Event Listeners** sidebar tab in the Elements panel when a listener for it is added to an element, and (2) be listed under an appropriate category in the **Event Listener Breakpoints** tab in the Sources panel.
|
58
72
|
|
59
|
-
|
73
|
+
Displaying the event in the Elements panel's 'Event Listeners' tab is often automatically supported, as this tab reflects the runtime state of the element.
|
74
|
+
|
75
|
+
However, adding the event to the 'Event Listener Breakpoints' tab is not automatic. The list of debuggable events is maintained in the DevTools frontend. Adding a new event requires modifying this list to make it visible in the UI under an "appropriate category" (a logical grouping like `Mouse` or `Keyboard`). If a suitable category doesn't exist, a new one should be created.
|
60
76
|
|
61
77
|

|
62
78
|
|
@@ -65,28 +81,38 @@ Pointer: [`front_end/core/sdk/DOMDebuggerModel.ts`](https://source.chromium.org/
|
|
65
81
|
|
66
82
|
## CSS
|
67
83
|
|
68
|
-
For CSS WPFs, basic
|
84
|
+
For CSS WPFs, basic support involves the ability to view and edit styles via the DevTools Styles tab.
|
69
85
|
This mostly works out of the box, but some minimal changes might be needed depending on the specifics.
|
70
86
|
|
71
87
|
### New CSS at-rules
|
72
88
|
|
89
|
+
> **Basic support requirement:** The new at-rule and its contents are displayed in the Styles tab, correctly linked to the stylesheet, and editable.
|
90
|
+
|
73
91
|
WPFs that introduce new CSS at-rules (i.e. `@foo (bar: baz) { … }`) must surface the new at-rules over the Chrome
|
74
|
-
DevTools Protocol (CDP) so that DevTools can show them in the Styles
|
92
|
+
DevTools Protocol (CDP) so that DevTools can show them in the Styles tab. Interlinking the at-rule to the style rules that reference it (e.g., linking a `@property` definition to its usage) is considered extended support and is not a requirement for shipping.
|
75
93
|
Please refer to [goo.gle/devtools-generic-at](https://goo.gle/devtools-generic-at) for instructions and examples on
|
76
94
|
how to add DevTools support for a new at-rule.
|
77
95
|
|
78
96
|
### New CSS pseudo-classes
|
79
97
|
|
80
|
-
|
98
|
+
> **Basic support requirement:** The new pseudo-class must be toggleable in the 'Force element state' UI. When the pseudo-class is active, the corresponding style rules must appear and be editable in the Styles tab, just like any other style rule.
|
99
|
+
|
100
|
+
To add a new pseudo-class to the UI, you must add it to the list of states in the constructor of `ElementStatePaneWidget`.
|
81
101
|
|
82
102
|

|
83
103
|
|
104
|
+
Pointer: [`front_end/panels/elements/ElementStatePaneWidget.ts`](https://source.chromium.org/chromium/chromium/src/+/main:third_party/devtools-frontend/src/front_end/panels/elements/ElementStatePaneWidget.ts)
|
105
|
+
|
84
106
|
Example for `:target`: [Chromium back-end CL](https://chromium-review.googlesource.com/c/chromium/src/+/2575668),
|
85
107
|
[DevTools front-end CL](https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2581544).
|
86
108
|
|
87
109
|
### New CSS properties or values
|
88
110
|
|
89
|
-
|
111
|
+
> **Basic support requirement:** The new CSS property or value is recognized by the Styles tab, autocompletes correctly, and does not show up as an "Unknown Property".
|
112
|
+
|
113
|
+
Any new CSS property that is applied to an element should also appear correctly in the **Computed** tab of the Elements panel, displaying its resolved value. This is generally automatic, as the Computed tab reflects the browser's computed style.
|
114
|
+
|
115
|
+
To recognize new CSS properties/values in the DevTools Styles tab’s autocomplete functionality, roll
|
90
116
|
[Chromium’s `css_properties.json5`](https://source.chromium.org/chromium/chromium/src/+/main:third\_party/blink/renderer/core/css/css_properties.json5;drc=be2c473625b9c28a4ff6735547cb0c1b6743f4ae) into the `devtools-frontend` repository by running
|
91
117
|
```bash
|
92
118
|
devtools-frontend/src/scripts/deps/roll_deps.py
|
@@ -95,26 +121,53 @@ see this [example CL](https://chromium-review.googlesource.com/c/devtools/devtoo
|
|
95
121
|
|
96
122
|

|
97
123
|
|
124
|
+
Additionally, verify that the Styles tab tooltips showing the property's definition and baseline status are correct and up-to-date. Otherwise, let DevTools team know that this should be updated.
|
125
|
+
|
126
|
+
### New CSS Functions and Value Indirection
|
127
|
+
|
128
|
+
> **Basic support requirement:** The new function or value mechanism is correctly parsed and displayed in the Styles tab, showing the *authored* value (e.g., `var(--my-color)`). Hovering over the value should reveal its computed result in a tooltip. The function name should also be autocompleted.
|
129
|
+
|
130
|
+
Support for new CSS functions and other forms of value indirection (like CSS custom properties via `var()`) is a mix of automatic and manual work. While the browser's backend handles parsing and computation, ensuring the DevTools UI provides features like autocomplete for new function names or value tracing in hover-to-resolve tooltips require frontend changes. Value tracing example can be found [here](https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6269777).
|
131
|
+
|
132
|
+
### New CSS pseudo-elements
|
133
|
+
|
134
|
+
> **Basic support requirement:** If the new pseudo-element is tree-abiding, it is displayed in the DOM tree (usually as a child of its originating element) and can be selected to inspect and edit its styles in the Styles tab. If it participates in style cascade of its originating element, its participating style should show up in the originating element's Style tab sections as well (e.g. Pseudo ::before element section).
|
135
|
+
|
136
|
+
Support for new pseudo-elements is not automatic. The browser's backend must be updated to expose the new pseudo-element over the Chrome DevTools Protocol (CDP). Additionally, the DevTools frontend must be updated to recognize and display these pseudo-elements in the Elements panel.
|
137
|
+
|
138
|
+
Pointers: [InspectorDOMAgent's supported pesudos](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/inspector/inspector_dom_agent.cc;l=122;drc=90e6a37b7c43154ea99d7cc7ff632ee181078fb2), [InspectorStyleResolver's list of supported pseudo-elements](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/inspector/inspector_style_resolver.cc;l=57-71;drc=c182cb38dc164e2b83c75cdf8699b076dfe6bc5e), and [DevTools Frontend DOMModel updates example CL](https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6195233).
|
139
|
+
|
98
140
|
|
99
141
|
## Network-related features
|
100
142
|
|
101
|
-
|
102
|
-
|
143
|
+
### New request types
|
144
|
+
|
145
|
+
> **Basic support requirement:** Any request initiated by the feature must appear as a distinct row in the Network panel with the correct **Type** (e.g., 'fetch', 'image'). This includes, at a minimum, the URL, status, method, size, and timing. Crucially, the **Initiator** column must correctly identify the source of the request.
|
146
|
+
|
147
|
+
Support for new request types is not automatic. It requires instrumenting the browser's network stack to send the right information to DevTools via the Chrome DevTools Protocol (CDP). The DevTools frontend may also need to be updated to correctly classify and display the new request type.
|
148
|
+
|
149
|
+
Pointer: The `ResourceType` class in [`front_end/core/common/ResourceType.ts`](https://source.chromium.org/chromium/chromium/src/+/main:third_party/devtools-frontend/src/front_end/core/common/ResourceType.ts) is the source of truth for request types in the frontend.
|
150
|
+
|
151
|
+
### New network protocols or data formats
|
152
|
+
|
153
|
+
> **Basic support requirement:** The new protocol or data format is identifiable in the Network panel. For new protocols, individual frames or messages should be inspectable. For new data formats, the response should be displayed in a format that is at least debuggable.
|
154
|
+
|
155
|
+
Note that this level of support often requires significant implementation in both the browser's backend and the DevTools frontend to correctly interpret and display the new protocol's data. Aim for correctness first, then consider improving UX in a follow-up.
|
103
156
|
|
104
|
-
|
105
|
-
|
157
|
+
---
|
158
|
+
*Extended support might involve a dedicated panel for a new protocol, such as the one for WebSockets, [DirectSockets CL1](https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6316791), [DirectSockets CL2](https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6406321), or the custom tab for [Trust Tokens](http://crbug.com/1126824) shown below.*
|
106
159
|
|
107
160
|

|
108
161
|
|
109
162
|
|
110
|
-
##
|
163
|
+
## Storage, Workers, and Background Services
|
111
164
|
|
112
165
|
WPFs related to Web Application Manifest, service workers, background services, notifications, storage, caching are
|
113
166
|
covered under the DevTools Application tab. Given the broad scope of features captured here, there is no generic
|
114
167
|
guidance that applies, other than: review the existing DevTools functionality related to your WPF, and ensure the
|
115
168
|
new WPF works well with it.
|
116
169
|
|
117
|
-
Depending on the WPF specifics, extended
|
170
|
+
Depending on the WPF specifics, extended support might be warranted. For example, [Trust Tokens](http://crbug.com/1126824)
|
118
171
|
shipped with a new subpanel under the Application tab:
|
119
172
|
|
120
173
|

|
@@ -126,7 +179,7 @@ your Intent email.
|
|
126
179
|
## Warnings, deprecations, removals
|
127
180
|
|
128
181
|
If your Blink Intent is about the deprecation/removal of a WPF, or an otherwise risky change from a Web compatibility
|
129
|
-
standpoint, the basic
|
182
|
+
standpoint, the basic support requirement can be satisfied by integrating with DevTools’ Issues panel. See
|
130
183
|
[how to pipe your messages into the Issues tab](https://docs.google.com/document/d/13zZBu6RG7D23FSWecSy3AHPEdFHJMkp732-uJ5CFbmc)
|
131
184
|
for details.
|
132
185
|
|
@@ -401,6 +401,9 @@ export class InspectorFrontendHostStub implements InspectorFrontendHostAPI {
|
|
401
401
|
devToolsFlexibleLayout: {
|
402
402
|
verticalDrawerEnabled: true,
|
403
403
|
},
|
404
|
+
devToolsStartingStyleDebugging: {
|
405
|
+
enabled: false,
|
406
|
+
},
|
404
407
|
};
|
405
408
|
if ('hostConfigForTesting' in globalThis) {
|
406
409
|
const {hostConfigForTesting} = (globalThis as unknown as {hostConfigForTesting: Root.Runtime.HostConfig});
|
@@ -499,6 +499,10 @@ interface DevToolsFlexibleLayout {
|
|
499
499
|
verticalDrawerEnabled: boolean;
|
500
500
|
}
|
501
501
|
|
502
|
+
interface DevToolsStartingStyleDebugging {
|
503
|
+
enabled: boolean;
|
504
|
+
}
|
505
|
+
|
502
506
|
/**
|
503
507
|
* The host configuration that we expect from the DevTools back-end.
|
504
508
|
*
|
@@ -544,6 +548,7 @@ export type HostConfig = Platform.TypeScriptUtilities.RecursivePartial<{
|
|
544
548
|
devToolsGdpProfilesAvailability: GdpProfilesAvailability,
|
545
549
|
devToolsLiveEdit: LiveEdit,
|
546
550
|
devToolsFlexibleLayout: DevToolsFlexibleLayout,
|
551
|
+
devToolsStartingStyleDebugging: DevToolsStartingStyleDebugging,
|
547
552
|
}>;
|
548
553
|
|
549
554
|
/**
|
@@ -462,6 +462,12 @@ export class CSSModel extends SDKModel<EventTypes> {
|
|
462
462
|
return new InlineStyleResult(inlineStyle, attributesStyle);
|
463
463
|
}
|
464
464
|
|
465
|
+
forceStartingStyle(node: DOMNode, forced: boolean): boolean {
|
466
|
+
void this.agent.invoke_forceStartingStyle({nodeId: node.id, forced});
|
467
|
+
this.dispatchEventToListeners(Events.StartingStylesStateForced, node);
|
468
|
+
return true;
|
469
|
+
}
|
470
|
+
|
465
471
|
forcePseudoState(node: DOMNode, pseudoClass: string, enable: boolean): boolean {
|
466
472
|
const forcedPseudoClasses = node.marker<string[]>(PseudoStateMarker) || [];
|
467
473
|
const hasPseudoClass = forcedPseudoClasses.includes(pseudoClass);
|
@@ -938,6 +944,7 @@ export enum Events {
|
|
938
944
|
ModelWasEnabled = 'ModelWasEnabled',
|
939
945
|
ModelDisposed = 'ModelDisposed',
|
940
946
|
PseudoStateForced = 'PseudoStateForced',
|
947
|
+
StartingStylesStateForced = 'StartingStylesStateForced',
|
941
948
|
StyleSheetAdded = 'StyleSheetAdded',
|
942
949
|
StyleSheetChanged = 'StyleSheetChanged',
|
943
950
|
StyleSheetRemoved = 'StyleSheetRemoved',
|
@@ -966,6 +973,7 @@ export interface EventTypes {
|
|
966
973
|
[Events.ModelWasEnabled]: void;
|
967
974
|
[Events.ModelDisposed]: CSSModel;
|
968
975
|
[Events.PseudoStateForced]: PseudoStateForcedEvent;
|
976
|
+
[Events.StartingStylesStateForced]: DOMNode;
|
969
977
|
[Events.StyleSheetAdded]: CSSStyleSheetHeader;
|
970
978
|
[Events.StyleSheetChanged]: StyleSheetChangedEvent;
|
971
979
|
[Events.StyleSheetRemoved]: CSSStyleSheetHeader;
|
@@ -11,6 +11,7 @@ import {CSSLayer} from './CSSLayer.js';
|
|
11
11
|
import {CSSMedia} from './CSSMedia.js';
|
12
12
|
import type {CSSModel, Edit} from './CSSModel.js';
|
13
13
|
import {CSSScope} from './CSSScope.js';
|
14
|
+
import {CSSStartingStyle} from './CSSStartingStyle.js';
|
14
15
|
import {CSSStyleDeclaration, Type} from './CSSStyleDeclaration.js';
|
15
16
|
import type {CSSStyleSheetHeader} from './CSSStyleSheetHeader.js';
|
16
17
|
import {CSSSupports} from './CSSSupports.js';
|
@@ -108,6 +109,7 @@ export class CSSStyleRule extends CSSRule {
|
|
108
109
|
scopes: CSSScope[];
|
109
110
|
layers: CSSLayer[];
|
110
111
|
ruleTypes: Protocol.CSS.CSSRuleType[];
|
112
|
+
startingStyles: CSSStartingStyle[];
|
111
113
|
wasUsed: boolean;
|
112
114
|
constructor(cssModel: CSSModel, payload: Protocol.CSS.CSSRule, wasUsed?: boolean) {
|
113
115
|
super(cssModel, {origin: payload.origin, style: payload.style, header: styleSheetHeaderForRule(cssModel, payload)});
|
@@ -120,6 +122,8 @@ export class CSSStyleRule extends CSSRule {
|
|
120
122
|
this.scopes = payload.scopes ? CSSScope.parseScopesPayload(cssModel, payload.scopes) : [];
|
121
123
|
this.supports = payload.supports ? CSSSupports.parseSupportsPayload(cssModel, payload.supports) : [];
|
122
124
|
this.layers = payload.layers ? CSSLayer.parseLayerPayload(cssModel, payload.layers) : [];
|
125
|
+
this.startingStyles =
|
126
|
+
payload.startingStyles ? CSSStartingStyle.parseStartingStylePayload(cssModel, payload.startingStyles) : [];
|
123
127
|
this.ruleTypes = payload.ruleTypes || [];
|
124
128
|
this.wasUsed = wasUsed || false;
|
125
129
|
}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
// Copyright 2025 The Chromium Authors
|
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 type * as Protocol from '../../generated/protocol.js';
|
6
|
+
import * as TextUtils from '../../models/text_utils/text_utils.js';
|
7
|
+
|
8
|
+
import type {CSSModel} from './CSSModel.js';
|
9
|
+
import {CSSQuery} from './CSSQuery.js';
|
10
|
+
|
11
|
+
export class CSSStartingStyle extends CSSQuery {
|
12
|
+
static parseStartingStylePayload(cssModel: CSSModel, payload: Protocol.CSS.CSSStartingStyle[]): CSSStartingStyle[] {
|
13
|
+
return payload.map(p => new CSSStartingStyle(cssModel, p));
|
14
|
+
}
|
15
|
+
|
16
|
+
constructor(cssModel: CSSModel, payload: Protocol.CSS.CSSStartingStyle) {
|
17
|
+
super(cssModel);
|
18
|
+
this.reinitialize(payload);
|
19
|
+
}
|
20
|
+
|
21
|
+
reinitialize(payload: Protocol.CSS.CSSStartingStyle): void {
|
22
|
+
this.range = payload.range ? TextUtils.TextRange.TextRange.fromObject(payload.range) : null;
|
23
|
+
this.styleSheetId = payload.styleSheetId;
|
24
|
+
}
|
25
|
+
|
26
|
+
active(): boolean {
|
27
|
+
return true;
|
28
|
+
}
|
29
|
+
}
|
@@ -126,6 +126,7 @@ export class DOMNode {
|
|
126
126
|
#xmlVersion!: string|undefined;
|
127
127
|
#isSVGNode!: boolean;
|
128
128
|
#isScrollable!: boolean;
|
129
|
+
#affectedByStartingStyles!: boolean;
|
129
130
|
#creationStackTrace: Promise<Protocol.Runtime.StackTrace|null>|null = null;
|
130
131
|
#pseudoElements = new Map<string, DOMNode[]>();
|
131
132
|
#distributedNodes: DOMNodeShortcut[] = [];
|
@@ -194,6 +195,7 @@ export class DOMNode {
|
|
194
195
|
this.#xmlVersion = payload.xmlVersion;
|
195
196
|
this.#isSVGNode = Boolean(payload.isSVG);
|
196
197
|
this.#isScrollable = Boolean(payload.isScrollable);
|
198
|
+
this.#affectedByStartingStyles = Boolean(payload.affectedByStartingStyles);
|
197
199
|
this.#retainedNodes = retainedNodes;
|
198
200
|
|
199
201
|
if (this.#retainedNodes?.has(this.backendNodeId())) {
|
@@ -296,6 +298,10 @@ export class DOMNode {
|
|
296
298
|
return this.#isScrollable;
|
297
299
|
}
|
298
300
|
|
301
|
+
affectedByStartingStyles(): boolean {
|
302
|
+
return this.#affectedByStartingStyles;
|
303
|
+
}
|
304
|
+
|
299
305
|
isMediaNode(): boolean {
|
300
306
|
return this.#nodeName === 'AUDIO' || this.#nodeName === 'VIDEO';
|
301
307
|
}
|
@@ -349,6 +355,10 @@ export class DOMNode {
|
|
349
355
|
this.#isScrollable = isScrollable;
|
350
356
|
}
|
351
357
|
|
358
|
+
setAffectedByStartingStyles(affectedByStartingStyles: boolean): void {
|
359
|
+
this.#affectedByStartingStyles = affectedByStartingStyles;
|
360
|
+
}
|
361
|
+
|
352
362
|
hasAttributes(): boolean {
|
353
363
|
return this.#attributes.size > 0;
|
354
364
|
}
|
@@ -1565,6 +1575,15 @@ export class DOMModel extends SDKModel<EventTypes> {
|
|
1565
1575
|
this.dispatchEventToListeners(Events.ScrollableFlagUpdated, {node});
|
1566
1576
|
}
|
1567
1577
|
|
1578
|
+
affectedByStartingStylesFlagUpdated(nodeId: Protocol.DOM.NodeId, affectedByStartingStyles: boolean): void {
|
1579
|
+
const node = this.nodeForId(nodeId);
|
1580
|
+
if (!node || node.affectedByStartingStyles() === affectedByStartingStyles) {
|
1581
|
+
return;
|
1582
|
+
}
|
1583
|
+
node.setAffectedByStartingStyles(affectedByStartingStyles);
|
1584
|
+
this.dispatchEventToListeners(Events.AffectedByStartingStylesFlagUpdated, {node});
|
1585
|
+
}
|
1586
|
+
|
1568
1587
|
topLayerElementsUpdated(): void {
|
1569
1588
|
this.dispatchEventToListeners(Events.TopLayerElementsChanged);
|
1570
1589
|
}
|
@@ -1751,6 +1770,7 @@ export enum Events {
|
|
1751
1770
|
MarkersChanged = 'MarkersChanged',
|
1752
1771
|
TopLayerElementsChanged = 'TopLayerElementsChanged',
|
1753
1772
|
ScrollableFlagUpdated = 'ScrollableFlagUpdated',
|
1773
|
+
AffectedByStartingStylesFlagUpdated = 'AffectedByStartingStylesFlagUpdated',
|
1754
1774
|
/* eslint-enable @typescript-eslint/naming-convention */
|
1755
1775
|
}
|
1756
1776
|
|
@@ -1767,6 +1787,7 @@ export interface EventTypes {
|
|
1767
1787
|
[Events.MarkersChanged]: DOMNode;
|
1768
1788
|
[Events.TopLayerElementsChanged]: void;
|
1769
1789
|
[Events.ScrollableFlagUpdated]: {node: DOMNode};
|
1790
|
+
[Events.AffectedByStartingStylesFlagUpdated]: {node: DOMNode};
|
1770
1791
|
}
|
1771
1792
|
|
1772
1793
|
class DOMDispatcher implements ProtocolProxyApi.DOMDispatcher {
|
@@ -1839,7 +1860,9 @@ class DOMDispatcher implements ProtocolProxyApi.DOMDispatcher {
|
|
1839
1860
|
this.#domModel.scrollableFlagUpdated(nodeId, isScrollable);
|
1840
1861
|
}
|
1841
1862
|
|
1842
|
-
affectedByStartingStylesFlagUpdated(
|
1863
|
+
affectedByStartingStylesFlagUpdated({nodeId, affectedByStartingStyles}:
|
1864
|
+
Protocol.DOM.AffectedByStartingStylesFlagUpdatedEvent): void {
|
1865
|
+
this.#domModel.affectedByStartingStylesFlagUpdated(nodeId, affectedByStartingStyles);
|
1843
1866
|
}
|
1844
1867
|
}
|
1845
1868
|
|