豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

Commit 174bfd0

Browse files
nroscinoDevtools-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/8697139552912874257 R=chrome-devtools-waterfall-gardener-emea-oncall@google.com Bug: none Change-Id: I50a962385c5ef9f3a8863fc2c056ad5ea24d9f08 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/7204539 Reviewed-by: Nicholas Roscino <nroscino@chromium.org> Reviewed-by: Eric Leese <leese@chromium.org> Reviewed-by: Alex Rudenko <alexrudenko@chromium.org> Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
1 parent 1669e7e commit 174bfd0

33 files changed

+289
-201
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': '679b33a98ae546ff521eee2ea28d8d5bf28872ba',
2525

2626
# Keeping track of the last time we rolled the browser protocol files.
27-
'chromium_browser_protocol_revision' : '80e288764853366da870ce585152ff22c763e128',
27+
'chromium_browser_protocol_revision' : '3e09060fabbdeb607bc7ed4db07e88ef0112f839',
2828

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

front_end/core/sdk/CSSModel.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ describeWithMockConnection('CSSModel', () => {
2929
const target = createTarget();
3030
const cssModel = new SDK.CSSModel.CSSModel(target);
3131
const header: Protocol.CSS.CSSStyleSheetHeader = {
32-
styleSheetId: 'stylesheet' as Protocol.CSS.StyleSheetId,
32+
styleSheetId: 'stylesheet' as Protocol.DOM.StyleSheetId,
3333
frameId: 'frame' as Protocol.Page.FrameId,
3434
sourceURL: 'http://stylesheet.test/404.css',
3535
origin: Protocol.CSS.StyleSheetOrigin.Regular,
@@ -57,7 +57,7 @@ describeWithMockConnection('CSSModel', () => {
5757
let target: SDK.Target.Target;
5858
let cssModel: SDK.CSSModel.CSSModel|null;
5959
const header: Protocol.CSS.CSSStyleSheetHeader = {
60-
styleSheetId: 'stylesheet' as Protocol.CSS.StyleSheetId,
60+
styleSheetId: 'stylesheet' as Protocol.DOM.StyleSheetId,
6161
frameId: 'frame' as Protocol.Page.FrameId,
6262
sourceURL: 'http://example.com/styles.css',
6363
origin: Protocol.CSS.StyleSheetOrigin.Regular,
@@ -114,7 +114,7 @@ describeWithMockConnection('CSSModel', () => {
114114
const target = createTarget();
115115
const cssModel = target.model(SDK.CSSModel.CSSModel)!;
116116

117-
assert.isNull(await cssModel.getStyleSheetText('id' as Protocol.CSS.StyleSheetId));
117+
assert.isNull(await cssModel.getStyleSheetText('id' as Protocol.DOM.StyleSheetId));
118118
});
119119
});
120120
});

front_end/core/sdk/CSSModel.ts

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ export class CSSModel extends SDKModel<EventTypes> {
5252
readonly #styleLoader: ComputedStyleLoader;
5353
readonly #stylePollingThrottler = new Common.Throttler.Throttler(StylePollingInterval);
5454
readonly #styleSheetIdsForURL =
55-
new Map<Platform.DevToolsPath.UrlString, Map<string, Set<Protocol.CSS.StyleSheetId>>>();
56-
readonly #styleSheetIdToHeader = new Map<Protocol.CSS.StyleSheetId, CSSStyleSheetHeader>();
55+
new Map<Platform.DevToolsPath.UrlString, Map<string, Set<Protocol.DOM.StyleSheetId>>>();
56+
readonly #styleSheetIdToHeader = new Map<Protocol.DOM.StyleSheetId, CSSStyleSheetHeader>();
5757
#cachedMatchedCascadeNode: DOMNode|null = null;
5858
#cachedMatchedCascadePromise: Promise<CSSMatchedStyles|null>|null = null;
5959
#cssPropertyTracker: CSSPropertyTracker|null = null;
@@ -183,7 +183,7 @@ export class CSSModel extends SDKModel<EventTypes> {
183183
}
184184

185185
async setStyleText(
186-
styleSheetId: Protocol.CSS.StyleSheetId, range: TextUtils.TextRange.TextRange, text: string,
186+
styleSheetId: Protocol.DOM.StyleSheetId, range: TextUtils.TextRange.TextRange, text: string,
187187
majorChange: boolean): Promise<boolean> {
188188
try {
189189
await this.ensureOriginalStyleSheetText(styleSheetId);
@@ -204,7 +204,7 @@ export class CSSModel extends SDKModel<EventTypes> {
204204
}
205205
}
206206

207-
async setSelectorText(styleSheetId: Protocol.CSS.StyleSheetId, range: TextUtils.TextRange.TextRange, text: string):
207+
async setSelectorText(styleSheetId: Protocol.DOM.StyleSheetId, range: TextUtils.TextRange.TextRange, text: string):
208208
Promise<boolean> {
209209
Host.userMetrics.actionTaken(Host.UserMetrics.Action.StyleRuleEdited);
210210

@@ -226,7 +226,7 @@ export class CSSModel extends SDKModel<EventTypes> {
226226
}
227227

228228
async setPropertyRulePropertyName(
229-
styleSheetId: Protocol.CSS.StyleSheetId, range: TextUtils.TextRange.TextRange, text: string): Promise<boolean> {
229+
styleSheetId: Protocol.DOM.StyleSheetId, range: TextUtils.TextRange.TextRange, text: string): Promise<boolean> {
230230
Host.userMetrics.actionTaken(Host.UserMetrics.Action.StyleRuleEdited);
231231

232232
try {
@@ -247,7 +247,7 @@ export class CSSModel extends SDKModel<EventTypes> {
247247
}
248248
}
249249

250-
async setKeyframeKey(styleSheetId: Protocol.CSS.StyleSheetId, range: TextUtils.TextRange.TextRange, text: string):
250+
async setKeyframeKey(styleSheetId: Protocol.DOM.StyleSheetId, range: TextUtils.TextRange.TextRange, text: string):
251251
Promise<boolean> {
252252
Host.userMetrics.actionTaken(Host.UserMetrics.Action.StyleRuleEdited);
253253

@@ -367,7 +367,7 @@ export class CSSModel extends SDKModel<EventTypes> {
367367
return await CSSMatchedStyles.create(payload);
368368
}
369369

370-
async getClassNames(styleSheetId: Protocol.CSS.StyleSheetId): Promise<string[]> {
370+
async getClassNames(styleSheetId: Protocol.DOM.StyleSheetId): Promise<string[]> {
371371
const {classNames} = await this.agent.invoke_collectClassNames({styleSheetId});
372372
return classNames || [];
373373
}
@@ -502,7 +502,7 @@ export class CSSModel extends SDKModel<EventTypes> {
502502
}
503503

504504
async setMediaText(
505-
styleSheetId: Protocol.CSS.StyleSheetId, range: TextUtils.TextRange.TextRange,
505+
styleSheetId: Protocol.DOM.StyleSheetId, range: TextUtils.TextRange.TextRange,
506506
newMediaText: string): Promise<boolean> {
507507
Host.userMetrics.actionTaken(Host.UserMetrics.Action.StyleRuleEdited);
508508

@@ -524,7 +524,7 @@ export class CSSModel extends SDKModel<EventTypes> {
524524
}
525525

526526
async setContainerQueryText(
527-
styleSheetId: Protocol.CSS.StyleSheetId, range: TextUtils.TextRange.TextRange,
527+
styleSheetId: Protocol.DOM.StyleSheetId, range: TextUtils.TextRange.TextRange,
528528
newContainerQueryText: string): Promise<boolean> {
529529
Host.userMetrics.actionTaken(Host.UserMetrics.Action.StyleRuleEdited);
530530

@@ -547,7 +547,7 @@ export class CSSModel extends SDKModel<EventTypes> {
547547
}
548548

549549
async setSupportsText(
550-
styleSheetId: Protocol.CSS.StyleSheetId, range: TextUtils.TextRange.TextRange,
550+
styleSheetId: Protocol.DOM.StyleSheetId, range: TextUtils.TextRange.TextRange,
551551
newSupportsText: string): Promise<boolean> {
552552
Host.userMetrics.actionTaken(Host.UserMetrics.Action.StyleRuleEdited);
553553

@@ -569,7 +569,7 @@ export class CSSModel extends SDKModel<EventTypes> {
569569
}
570570

571571
async setScopeText(
572-
styleSheetId: Protocol.CSS.StyleSheetId, range: TextUtils.TextRange.TextRange,
572+
styleSheetId: Protocol.DOM.StyleSheetId, range: TextUtils.TextRange.TextRange,
573573
newScopeText: string): Promise<boolean> {
574574
Host.userMetrics.actionTaken(Host.UserMetrics.Action.StyleRuleEdited);
575575

@@ -590,7 +590,7 @@ export class CSSModel extends SDKModel<EventTypes> {
590590
}
591591
}
592592

593-
async addRule(styleSheetId: Protocol.CSS.StyleSheetId, ruleText: string, ruleLocation: TextUtils.TextRange.TextRange):
593+
async addRule(styleSheetId: Protocol.DOM.StyleSheetId, ruleText: string, ruleLocation: TextUtils.TextRange.TextRange):
594594
Promise<CSSStyleRule|null> {
595595
try {
596596
await this.ensureOriginalStyleSheetText(styleSheetId);
@@ -657,19 +657,19 @@ export class CSSModel extends SDKModel<EventTypes> {
657657
return this.#fontFaces.get(src);
658658
}
659659

660-
styleSheetHeaderForId(id: Protocol.CSS.StyleSheetId): CSSStyleSheetHeader|null {
660+
styleSheetHeaderForId(id: Protocol.DOM.StyleSheetId): CSSStyleSheetHeader|null {
661661
return this.#styleSheetIdToHeader.get(id) || null;
662662
}
663663

664664
styleSheetHeaders(): CSSStyleSheetHeader[] {
665665
return [...this.#styleSheetIdToHeader.values()];
666666
}
667667

668-
fireStyleSheetChanged(styleSheetId: Protocol.CSS.StyleSheetId, edit?: Edit): void {
668+
fireStyleSheetChanged(styleSheetId: Protocol.DOM.StyleSheetId, edit?: Edit): void {
669669
this.dispatchEventToListeners(Events.StyleSheetChanged, {styleSheetId, edit});
670670
}
671671

672-
private ensureOriginalStyleSheetText(styleSheetId: Protocol.CSS.StyleSheetId): Promise<string|null> {
672+
private ensureOriginalStyleSheetText(styleSheetId: Protocol.DOM.StyleSheetId): Promise<string|null> {
673673
const header = this.styleSheetHeaderForId(styleSheetId);
674674
if (!header) {
675675
return Promise.resolve(null);
@@ -732,7 +732,7 @@ export class CSSModel extends SDKModel<EventTypes> {
732732
this.dispatchEventToListeners(Events.StyleSheetAdded, styleSheetHeader);
733733
}
734734

735-
styleSheetRemoved(id: Protocol.CSS.StyleSheetId): void {
735+
styleSheetRemoved(id: Protocol.DOM.StyleSheetId): void {
736736
const header = this.#styleSheetIdToHeader.get(id);
737737
console.assert(Boolean(header));
738738
if (!header) {
@@ -760,7 +760,7 @@ export class CSSModel extends SDKModel<EventTypes> {
760760
this.dispatchEventToListeners(Events.StyleSheetRemoved, header);
761761
}
762762

763-
getStyleSheetIdsForURL(url: Platform.DevToolsPath.UrlString): Protocol.CSS.StyleSheetId[] {
763+
getStyleSheetIdsForURL(url: Platform.DevToolsPath.UrlString): Protocol.DOM.StyleSheetId[] {
764764
const frameIdToStyleSheetIds = this.#styleSheetIdsForURL.get(url);
765765
if (!frameIdToStyleSheetIds) {
766766
return [];
@@ -773,7 +773,7 @@ export class CSSModel extends SDKModel<EventTypes> {
773773
return result;
774774
}
775775

776-
async setStyleSheetText(styleSheetId: Protocol.CSS.StyleSheetId, newText: string, majorChange: boolean):
776+
async setStyleSheetText(styleSheetId: Protocol.DOM.StyleSheetId, newText: string, majorChange: boolean):
777777
Promise<string|null> {
778778
const header = this.#styleSheetIdToHeader.get(styleSheetId);
779779
if (!header) {
@@ -799,7 +799,7 @@ export class CSSModel extends SDKModel<EventTypes> {
799799
return null;
800800
}
801801

802-
async getStyleSheetText(styleSheetId: Protocol.CSS.StyleSheetId): Promise<string|null> {
802+
async getStyleSheetText(styleSheetId: Protocol.DOM.StyleSheetId): Promise<string|null> {
803803
const response = await this.agent.invoke_getStyleSheetText({styleSheetId});
804804
if (response.getError()) {
805805
return null;
@@ -953,7 +953,7 @@ export enum Events {
953953
}
954954

955955
export interface StyleSheetChangedEvent {
956-
styleSheetId: Protocol.CSS.StyleSheetId;
956+
styleSheetId: Protocol.DOM.StyleSheetId;
957957
edit?: Edit;
958958
}
959959

@@ -999,7 +999,7 @@ export class Edit {
999999

10001000
export class CSSLocation {
10011001
readonly #cssModel: CSSModel;
1002-
styleSheetId: Protocol.CSS.StyleSheetId;
1002+
styleSheetId: Protocol.DOM.StyleSheetId;
10031003
url: Platform.DevToolsPath.UrlString;
10041004
lineNumber: number;
10051005
columnNumber: number;

front_end/core/sdk/CSSQuery.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ type CSSQueryPayload =
1414
export abstract class CSSQuery {
1515
text = '';
1616
range?: TextUtils.TextRange.TextRange|null;
17-
styleSheetId?: Protocol.CSS.StyleSheetId;
17+
styleSheetId?: Protocol.DOM.StyleSheetId;
1818
protected cssModel: CSSModel;
1919

2020
constructor(cssModel: CSSModel) {

front_end/core/sdk/CSSRule.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import type {CSSStyleSheetHeader} from './CSSStyleSheetHeader.js';
1717
import {CSSSupports} from './CSSSupports.js';
1818

1919
function styleSheetHeaderForRule(
20-
cssModel: CSSModel, {styleSheetId}: {styleSheetId?: Protocol.CSS.StyleSheetId}): CSSStyleSheetHeader|null {
20+
cssModel: CSSModel, {styleSheetId}: {styleSheetId?: Protocol.DOM.StyleSheetId}): CSSStyleSheetHeader|null {
2121
return styleSheetId && cssModel.styleSheetHeaderForId(styleSheetId) || null;
2222
}
2323

@@ -143,7 +143,7 @@ export class CSSStyleRule extends CSSRule {
143143
selectors: [{text: selectorText, value: undefined}],
144144
},
145145
style: {
146-
styleSheetId: '0' as Protocol.CSS.StyleSheetId,
146+
styleSheetId: '0' as Protocol.DOM.StyleSheetId,
147147
range: new TextUtils.TextRange.TextRange(0, 0, 0, 0),
148148
shorthandEntries: [],
149149
cssProperties: [],

front_end/core/sdk/CSSStyleDeclaration.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ describeWithMockConnection('CSSStyleDeclaration', () => {
1919
const target = createTarget();
2020
const cssModel = new SDK.CSSModel.CSSModel(target);
2121
const stubCSSStyle = {
22-
styleSheetId: 'STYLE_SHEET_ID' as Protocol.CSS.StyleSheetId,
22+
styleSheetId: 'STYLE_SHEET_ID' as Protocol.DOM.StyleSheetId,
2323
cssProperties: [
2424
{
2525
name: 'margin',
@@ -105,7 +105,7 @@ describeWithMockConnection('CSSStyleDeclaration', () => {
105105
const target = createTarget();
106106
const cssModel = new SDK.CSSModel.CSSModel(target);
107107
const stubCSSStyle = {
108-
styleSheetId: 'STYLE_SHEET_ID' as Protocol.CSS.StyleSheetId,
108+
styleSheetId: 'STYLE_SHEET_ID' as Protocol.DOM.StyleSheetId,
109109
cssProperties: [
110110
{
111111
name: 'margin-top',
@@ -181,7 +181,7 @@ describeWithMockConnection('CSSStyleDeclaration', () => {
181181
const target = createTarget();
182182
const cssModel = new SDK.CSSModel.CSSModel(target);
183183
const stubCSSStyle = {
184-
styleSheetId: 'STYLE_SHEET_ID' as Protocol.CSS.StyleSheetId,
184+
styleSheetId: 'STYLE_SHEET_ID' as Protocol.DOM.StyleSheetId,
185185
cssProperties: [
186186
{
187187
name: '--a',
@@ -226,7 +226,7 @@ describeWithMockConnection('CSSStyleDeclaration', () => {
226226
const target = createTarget();
227227
const cssModel = new SDK.CSSModel.CSSModel(target);
228228
const stubCSSStyle = {
229-
styleSheetId: 'STYLE_SHEET_ID' as Protocol.CSS.StyleSheetId,
229+
styleSheetId: 'STYLE_SHEET_ID' as Protocol.DOM.StyleSheetId,
230230
cssProperties: [
231231
{
232232
name: '-webkit-background-clip',

front_end/core/sdk/CSSStyleDeclaration.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export class CSSStyleDeclaration {
1515
readonly #cssModel: CSSModel;
1616
parentRule: CSSRule|null;
1717
#allProperties: CSSProperty[] = [];
18-
styleSheetId?: Protocol.CSS.StyleSheetId;
18+
styleSheetId?: Protocol.DOM.StyleSheetId;
1919
range: TextUtils.TextRange.TextRange|null = null;
2020
cssText?: string;
2121
#shorthandValues = new Map<string, string>();

front_end/core/sdk/CSSStyleSheetHeader.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import * as SDK from './sdk.js';
99
describe('CSSStyleSheetHeader', () => {
1010
describe('createPageResourceLoadInitiator', () => {
1111
const frameId = 'Frame#123' as Protocol.Page.FrameId;
12-
const styleSheetId = 'StyleSheet#123' as Protocol.CSS.StyleSheetId;
12+
const styleSheetId = 'StyleSheet#123' as Protocol.DOM.StyleSheetId;
1313
const sourceURL = 'http://localhost/style.css';
1414

1515
it('yields the correct frame ID', () => {
@@ -108,7 +108,7 @@ describe('CSSStyleSheetHeader', () => {
108108

109109
describe('resourceURL()', () => {
110110
const frameId = '123' as Protocol.Page.FrameId;
111-
const styleSheetId = '456' as Protocol.CSS.StyleSheetId;
111+
const styleSheetId = '456' as Protocol.DOM.StyleSheetId;
112112
const sourceURL = 'http://localhost/style.css';
113113

114114
it('returns a unique resourceURL for inspector originated stylesheet', () => {

front_end/core/sdk/CSSStyleSheetHeader.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
3030

3131
export class CSSStyleSheetHeader implements TextUtils.ContentProvider.ContentProvider, FrameAssociated {
3232
#cssModel: CSSModel;
33-
id: Protocol.CSS.StyleSheetId;
33+
id: Protocol.DOM.StyleSheetId;
3434
frameId: Protocol.Page.FrameId;
3535
sourceURL: Platform.DevToolsPath.UrlString;
3636
hasSourceURL: boolean;

front_end/core/sdk/DOMModel.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1800,6 +1800,9 @@ class DOMDispatcher implements ProtocolProxyApi.DOMDispatcher {
18001800
constructor(domModel: DOMModel) {
18011801
this.#domModel = domModel;
18021802
}
1803+
adoptedStyleSheetsModified(_params: Protocol.DOM.AdoptedStyleSheetsModifiedEvent): void {
1804+
// TODO: implementation
1805+
}
18031806

18041807
documentUpdated(): void {
18051808
this.#domModel.documentUpdated();

0 commit comments

Comments
 (0)