Skip to content

Commit 63f5d0d

Browse files
ktranDevtools-frontend LUCI CQ
authored andcommitted
Roll browser-protocol
This roll requires a manual review. See http://go/reviewed-rolls for guidance. In case of failures or errors, reach out to someone from config/owner/COMMON_OWNERS. Roll created at https://cr-buildbucket.appspot.com/build/8732053358605651809 Changed CSSDispatcher to include newly added function. [email protected] Bug: 376426033 Change-Id: I3cd3c1e0a92e8a252354321b4f9d5483af35a174 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/5997351 Reviewed-by: Simon Zünd <[email protected]> Commit-Queue: Kim-Anh Tran <[email protected]>
1 parent 1eb3b06 commit 63f5d0d

File tree

9 files changed

+77
-1
lines changed

9 files changed

+77
-1
lines changed

DEPS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ vars = {
2424
'inspector_protocol_revision': '8a411ffb163cfea9fe281186daa15e937bc72109',
2525

2626
# Keeping track of the last time we rollerd the browser protocol files.
27-
'chromium_browser_protocol_revision' : '5ae8871f714913c331dee1b181d61fcb2ca02ecb',
27+
'chromium_browser_protocol_revision' : 'd4631ac72e5b6fac2dc454ff15a9d162b8c7fc4f',
2828

2929
'clang_format_url': 'https://chromium.googlesource.com/external/github.com/llvm/llvm-project/clang/tools/clang-format.git',
3030
'clang_format_revision': '3c0acd2d4e73dd911309d9e970ba09d58bf23a62',

front_end/core/sdk/CSSModel.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -990,6 +990,10 @@ class CSSDispatcher implements ProtocolProxyApi.CSSDispatcher {
990990
styleSheetRemoved({styleSheetId}: Protocol.CSS.StyleSheetRemovedEvent): void {
991991
this.#cssModel.styleSheetRemoved(styleSheetId);
992992
}
993+
994+
// TODO(crbug.com/376426033): Implement after protocol roll.
995+
computedStyleUpdated(_params: Protocol.CSS.ComputedStyleUpdatedEvent): void {
996+
}
993997
}
994998

995999
class ComputedStyleLoader {

front_end/generated/InspectorBackendCommands.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

front_end/generated/protocol-mapping.d.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ export namespace ProtocolMapping {
8181
* Fired whenever an active document stylesheet is removed.
8282
*/
8383
'CSS.styleSheetRemoved': [Protocol.CSS.StyleSheetRemovedEvent];
84+
'CSS.computedStyleUpdated': [Protocol.CSS.ComputedStyleUpdatedEvent];
8485
/**
8586
* This is fired whenever the list of available sinks changes. A sink is a
8687
* device or a software surface that you can cast to.
@@ -1303,6 +1304,15 @@ export namespace ProtocolMapping {
13031304
paramsType: [Protocol.CSS.GetLocationForSelectorRequest];
13041305
returnType: Protocol.CSS.GetLocationForSelectorResponse;
13051306
};
1307+
/**
1308+
* Starts tracking the given node for the computed style updates
1309+
* and whenever the computed style is updated for node, it queues
1310+
* a `computedStyleUpdated` event with throttling.
1311+
*/
1312+
'CSS.trackComputedStyleUpdatesForNode': {
1313+
paramsType: [Protocol.CSS.TrackComputedStyleUpdatesForNodeRequest?];
1314+
returnType: void;
1315+
};
13061316
/**
13071317
* Starts tracking the given computed styles for updates. The specified array of properties
13081318
* replaces the one previously specified. Pass empty array to disable tracking.

front_end/generated/protocol-proxy-api.d.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -703,6 +703,13 @@ declare namespace ProtocolProxyApi {
703703
*/
704704
invoke_getLocationForSelector(params: Protocol.CSS.GetLocationForSelectorRequest): Promise<Protocol.CSS.GetLocationForSelectorResponse>;
705705

706+
/**
707+
* Starts tracking the given node for the computed style updates
708+
* and whenever the computed style is updated for node, it queues
709+
* a `computedStyleUpdated` event with throttling.
710+
*/
711+
invoke_trackComputedStyleUpdatesForNode(params: Protocol.CSS.TrackComputedStyleUpdatesForNodeRequest): Promise<Protocol.ProtocolResponseWithError>;
712+
706713
/**
707714
* Starts tracking the given computed styles for updates. The specified array of properties
708715
* replaces the one previously specified. Pass empty array to disable tracking.
@@ -820,6 +827,8 @@ declare namespace ProtocolProxyApi {
820827
*/
821828
styleSheetRemoved(params: Protocol.CSS.StyleSheetRemovedEvent): void;
822829

830+
computedStyleUpdated(params: Protocol.CSS.ComputedStyleUpdatedEvent): void;
831+
823832
}
824833

825834
export interface CacheStorageApi {

front_end/generated/protocol.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3312,6 +3312,10 @@ export namespace CSS {
33123312
ranges: SourceRange[];
33133313
}
33143314

3315+
export interface TrackComputedStyleUpdatesForNodeRequest {
3316+
nodeId?: DOM.NodeId;
3317+
}
3318+
33153319
export interface TrackComputedStyleUpdatesRequest {
33163320
propertiesToTrack: CSSComputedStyleProperty[];
33173321
}
@@ -3508,6 +3512,13 @@ export namespace CSS {
35083512
*/
35093513
styleSheetId: StyleSheetId;
35103514
}
3515+
3516+
export interface ComputedStyleUpdatedEvent {
3517+
/**
3518+
* The node id that has updated computed styles.
3519+
*/
3520+
nodeId: DOM.NodeId;
3521+
}
35113522
}
35123523

35133524
export namespace CacheStorage {

front_end/models/javascript_metadata/NativeFunctions.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6902,6 +6902,11 @@ export const NativeFunctions = [
69026902
name: "CloseWatcher",
69036903
signatures: [["?options"]]
69046904
},
6905+
{
6906+
name: "requestClose",
6907+
signatures: [["?returnValue"]],
6908+
receivers: ["HTMLDialogElement"]
6909+
},
69056910
{
69066911
name: "reportEvent",
69076912
signatures: [["event"]]

third_party/blink/public/devtools_protocol/browser_protocol.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4887,6 +4887,18 @@
48874887
}
48884888
]
48894889
},
4890+
{
4891+
"name": "trackComputedStyleUpdatesForNode",
4892+
"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.",
4893+
"experimental": true,
4894+
"parameters": [
4895+
{
4896+
"name": "nodeId",
4897+
"optional": true,
4898+
"$ref": "DOM.NodeId"
4899+
}
4900+
]
4901+
},
48904902
{
48914903
"name": "trackComputedStyleUpdates",
48924904
"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 @@
52615273
"$ref": "StyleSheetId"
52625274
}
52635275
]
5276+
},
5277+
{
5278+
"name": "computedStyleUpdated",
5279+
"experimental": true,
5280+
"parameters": [
5281+
{
5282+
"name": "nodeId",
5283+
"description": "The node id that has updated computed styles.",
5284+
"$ref": "DOM.NodeId"
5285+
}
5286+
]
52645287
}
52655288
]
52665289
},

third_party/blink/public/devtools_protocol/browser_protocol.pdl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2319,6 +2319,13 @@ experimental domain CSS
23192319
returns
23202320
array of SourceRange ranges
23212321

2322+
# Starts tracking the given node for the computed style updates
2323+
# and whenever the computed style is updated for node, it queues
2324+
# a `computedStyleUpdated` event with throttling.
2325+
experimental command trackComputedStyleUpdatesForNode
2326+
parameters
2327+
optional DOM.NodeId nodeId
2328+
23222329
# Starts tracking the given computed styles for updates. The specified array of properties
23232330
# replaces the one previously specified. Pass empty array to disable tracking.
23242331
# Use takeComputedStyleUpdates to retrieve the list of nodes that had properties modified.
@@ -2486,6 +2493,11 @@ experimental domain CSS
24862493
# Identifier of the removed stylesheet.
24872494
StyleSheetId styleSheetId
24882495

2496+
experimental event computedStyleUpdated
2497+
parameters
2498+
# The node id that has updated computed styles.
2499+
DOM.NodeId nodeId
2500+
24892501
experimental domain CacheStorage
24902502
depends on Storage
24912503

0 commit comments

Comments
 (0)