diff --git a/changelog.md b/changelog.md index c182a478a5..cbdd9f56c1 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,36 @@ +## Roll protocol to r1378738 — _2024-11-06T04:29:39.000Z_ +###### Diff: [`7019b3c...51d701f`](https://github.com/ChromeDevTools/devtools-protocol/compare/7019b3c...51d701f) + +```diff +@@ browser_protocol.pdl:2319 @@ experimental domain CSS + returns + array of SourceRange ranges + ++ # Starts tracking the given node for the computed style updates ++ # and whenever the computed style is updated for node, it queues ++ # a `computedStyleUpdated` event with throttling. ++ experimental command trackComputedStyleUpdatesForNode ++ parameters ++ optional DOM.NodeId nodeId ++ + # Starts tracking the given computed styles for updates. The specified array of properties + # replaces the one previously specified. Pass empty array to disable tracking. + # Use takeComputedStyleUpdates to retrieve the list of nodes that had properties modified. +@@ -2486,6 +2493,11 @@ experimental domain CSS + # Identifier of the removed stylesheet. + StyleSheetId styleSheetId + ++ experimental event computedStyleUpdated ++ parameters ++ # The node id that has updated computed styles. ++ DOM.NodeId nodeId ++ + experimental domain CacheStorage + depends on Storage +``` + ## Roll protocol to r1377232 — _2024-11-02T04:29:34.000Z_ ###### Diff: [`b62e175...b1b0036`](https://github.com/ChromeDevTools/devtools-protocol/compare/b62e175...b1b0036) @@ -12138,18 +12169,4 @@ index 18cf0c7..8e43695 100644 # Allows overriding user agent with the given string. command setUserAgentOverride parameters -``` - -## Roll protocol to r1005560 — _2022-05-20T01:15:18.000Z_ -###### Diff: [`363a231...44eb39e`](https://github.com/ChromeDevTools/devtools-protocol/compare/363a231...44eb39e) - -```diff -@@ browser_protocol.pdl:751 @@ experimental domain Audits - CrossOriginWindowAlert - CrossOriginWindowConfirm - CSSSelectorInternalMediaControlsOverlayCastButton -- CustomCursorIntersectsViewport - DeprecationExample - DocumentDomainSettingWithoutOriginAgentClusterHeader - EventPath ``` \ No newline at end of file diff --git a/json/browser_protocol.json b/json/browser_protocol.json index b0fdcec8f4..478f8c8ac8 100644 --- a/json/browser_protocol.json +++ b/json/browser_protocol.json @@ -4887,6 +4887,18 @@ } ] }, + { + "name": "trackComputedStyleUpdatesForNode", + "description": "Starts tracking the given node for the computed style updates\nand whenever the computed style is updated for node, it queues\na `computedStyleUpdated` event with throttling.", + "experimental": true, + "parameters": [ + { + "name": "nodeId", + "optional": true, + "$ref": "DOM.NodeId" + } + ] + }, { "name": "trackComputedStyleUpdates", "description": "Starts tracking the given computed styles for updates. The specified array of properties\nreplaces the one previously specified. Pass empty array to disable tracking.\nUse takeComputedStyleUpdates to retrieve the list of nodes that had properties modified.\nThe changes to computed style properties are only tracked for nodes pushed to the front-end\nby the DOM agent. If no changes to the tracked properties occur after the node has been pushed\nto the front-end, no updates will be issued for the node.", @@ -5261,6 +5273,17 @@ "$ref": "StyleSheetId" } ] + }, + { + "name": "computedStyleUpdated", + "experimental": true, + "parameters": [ + { + "name": "nodeId", + "description": "The node id that has updated computed styles.", + "$ref": "DOM.NodeId" + } + ] } ] }, diff --git a/package.json b/package.json index a4ac22764c..11efadd94d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "devtools-protocol", - "version": "0.0.1378110", + "version": "0.0.1378738", "description": "The Chrome DevTools Protocol JSON", "repository": "https://github.com/ChromeDevTools/devtools-protocol", "author": "The Chromium Authors", diff --git a/pdl/browser_protocol.pdl b/pdl/browser_protocol.pdl index ec955c570d..e9e71407b3 100644 --- a/pdl/browser_protocol.pdl +++ b/pdl/browser_protocol.pdl @@ -2319,6 +2319,13 @@ experimental domain CSS returns array of SourceRange ranges + # Starts tracking the given node for the computed style updates + # and whenever the computed style is updated for node, it queues + # a `computedStyleUpdated` event with throttling. + experimental command trackComputedStyleUpdatesForNode + parameters + optional DOM.NodeId nodeId + # Starts tracking the given computed styles for updates. The specified array of properties # replaces the one previously specified. Pass empty array to disable tracking. # Use takeComputedStyleUpdates to retrieve the list of nodes that had properties modified. @@ -2486,6 +2493,11 @@ experimental domain CSS # Identifier of the removed stylesheet. StyleSheetId styleSheetId + experimental event computedStyleUpdated + parameters + # The node id that has updated computed styles. + DOM.NodeId nodeId + experimental domain CacheStorage depends on Storage diff --git a/types/protocol-mapping.d.ts b/types/protocol-mapping.d.ts index 39a6c2d306..f7221f6dcf 100644 --- a/types/protocol-mapping.d.ts +++ b/types/protocol-mapping.d.ts @@ -161,6 +161,7 @@ export namespace ProtocolMapping { * Fired whenever an active document stylesheet is removed. */ 'CSS.styleSheetRemoved': [Protocol.CSS.StyleSheetRemovedEvent]; + 'CSS.computedStyleUpdated': [Protocol.CSS.ComputedStyleUpdatedEvent]; /** * This is fired whenever the list of available sinks changes. A sink is a * device or a software surface that you can cast to. @@ -1871,6 +1872,15 @@ export namespace ProtocolMapping { paramsType: [Protocol.CSS.GetLocationForSelectorRequest]; returnType: Protocol.CSS.GetLocationForSelectorResponse; }; + /** + * Starts tracking the given node for the computed style updates + * and whenever the computed style is updated for node, it queues + * a `computedStyleUpdated` event with throttling. + */ + 'CSS.trackComputedStyleUpdatesForNode': { + paramsType: [Protocol.CSS.TrackComputedStyleUpdatesForNodeRequest?]; + returnType: void; + }; /** * Starts tracking the given computed styles for updates. The specified array of properties * replaces the one previously specified. Pass empty array to disable tracking. diff --git a/types/protocol-proxy-api.d.ts b/types/protocol-proxy-api.d.ts index 78e13ce4ca..a0d879c2e0 100644 --- a/types/protocol-proxy-api.d.ts +++ b/types/protocol-proxy-api.d.ts @@ -1102,6 +1102,13 @@ export namespace ProtocolProxyApi { */ getLocationForSelector(params: Protocol.CSS.GetLocationForSelectorRequest): Promise; + /** + * Starts tracking the given node for the computed style updates + * and whenever the computed style is updated for node, it queues + * a `computedStyleUpdated` event with throttling. + */ + trackComputedStyleUpdatesForNode(params: Protocol.CSS.TrackComputedStyleUpdatesForNodeRequest): Promise; + /** * Starts tracking the given computed styles for updates. The specified array of properties * replaces the one previously specified. Pass empty array to disable tracking. @@ -1217,6 +1224,8 @@ export namespace ProtocolProxyApi { */ on(event: 'styleSheetRemoved', listener: (params: Protocol.CSS.StyleSheetRemovedEvent) => void): void; + on(event: 'computedStyleUpdated', listener: (params: Protocol.CSS.ComputedStyleUpdatedEvent) => void): void; + } export interface CacheStorageApi { diff --git a/types/protocol-tests-proxy-api.d.ts b/types/protocol-tests-proxy-api.d.ts index 3c9ab8825d..ead9c36a7a 100644 --- a/types/protocol-tests-proxy-api.d.ts +++ b/types/protocol-tests-proxy-api.d.ts @@ -1170,6 +1170,13 @@ export namespace ProtocolTestsProxyApi { */ getLocationForSelector(params: Protocol.CSS.GetLocationForSelectorRequest): Promise<{id: number, result: Protocol.CSS.GetLocationForSelectorResponse, sessionId: string}>; + /** + * Starts tracking the given node for the computed style updates + * and whenever the computed style is updated for node, it queues + * a `computedStyleUpdated` event with throttling. + */ + trackComputedStyleUpdatesForNode(params: Protocol.CSS.TrackComputedStyleUpdatesForNodeRequest): Promise<{id: number, result: void, sessionId: string}>; + /** * Starts tracking the given computed styles for updates. The specified array of properties * replaces the one previously specified. Pass empty array to disable tracking. @@ -1295,6 +1302,10 @@ export namespace ProtocolTestsProxyApi { offStyleSheetRemoved(listener: (event: { params: Protocol.CSS.StyleSheetRemovedEvent }) => void): void; onceStyleSheetRemoved(eventMatcher?: (event: { params: Protocol.CSS.StyleSheetRemovedEvent }) => boolean): Promise<{ params: Protocol.CSS.StyleSheetRemovedEvent }>; + onComputedStyleUpdated(listener: (event: { params: Protocol.CSS.ComputedStyleUpdatedEvent }) => void): void; + offComputedStyleUpdated(listener: (event: { params: Protocol.CSS.ComputedStyleUpdatedEvent }) => void): void; + onceComputedStyleUpdated(eventMatcher?: (event: { params: Protocol.CSS.ComputedStyleUpdatedEvent }) => boolean): Promise<{ params: Protocol.CSS.ComputedStyleUpdatedEvent }>; + } export interface CacheStorageApi { diff --git a/types/protocol.d.ts b/types/protocol.d.ts index 7a4806bfdd..8a1fae7b3d 100644 --- a/types/protocol.d.ts +++ b/types/protocol.d.ts @@ -5574,6 +5574,10 @@ export namespace Protocol { ranges: SourceRange[]; } + export interface TrackComputedStyleUpdatesForNodeRequest { + nodeId?: DOM.NodeId; + } + export interface TrackComputedStyleUpdatesRequest { propertiesToTrack: CSSComputedStyleProperty[]; } @@ -5770,6 +5774,13 @@ export namespace Protocol { */ styleSheetId: StyleSheetId; } + + export interface ComputedStyleUpdatedEvent { + /** + * The node id that has updated computed styles. + */ + nodeId: DOM.NodeId; + } } export namespace CacheStorage {