Skip to content

Commit 6754373

Browse files
Lightning00BladeDevtools-frontend LUCI CQ
authored andcommitted
[cleanup] Shorten some types
Improve some type Bug: none Change-Id: I413d2d92907943fdaf2478034c03a480219bee48 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6298390 Commit-Queue: Ergün Erdoğmuş <[email protected]> Reviewed-by: Ergün Erdoğmuş <[email protected]> Commit-Queue: Nikolay Vitkov <[email protected]> Auto-Submit: Nikolay Vitkov <[email protected]>
1 parent a28b94e commit 6754373

File tree

4 files changed

+16
-9
lines changed

4 files changed

+16
-9
lines changed

front_end/core/sdk/CSSRule.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ export class CSSRule {
8686

8787
class CSSValue {
8888
text: string;
89-
range: TextUtils.TextRange.TextRange|undefined;
90-
specificity: Protocol.CSS.Specificity|undefined;
89+
range?: TextUtils.TextRange.TextRange;
90+
specificity?: Protocol.CSS.Specificity;
9191
constructor(payload: Protocol.CSS.Value) {
9292
this.text = payload.text;
9393
if (payload.range) {

front_end/core/sdk/CSSStyleDeclaration.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ export class CSSStyleDeclaration {
1515
readonly #cssModelInternal: CSSModel;
1616
parentRule: CSSRule|null;
1717
#allPropertiesInternal!: CSSProperty[];
18-
styleSheetId!: Protocol.CSS.StyleSheetId|undefined;
18+
styleSheetId?: Protocol.CSS.StyleSheetId;
1919
range!: TextUtils.TextRange.TextRange|null;
20-
cssText!: string|undefined;
20+
cssText?: string;
2121
#shorthandValues!: Map<string, string>;
2222
#shorthandIsImportant!: Set<string>;
2323
#activePropertyMap!: Map<string, CSSProperty>;

front_end/core/sdk/RemoteObject.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -299,10 +299,17 @@ export class RemoteObjectImpl extends RemoteObject {
299299
readonly #classNameInternal: string|null;
300300

301301
constructor(
302-
runtimeModel: RuntimeModel, objectId: Protocol.Runtime.RemoteObjectId|undefined, type: string,
303-
subtype: string|undefined, value: typeof RemoteObject.prototype.value, unserializableValue?: string,
304-
description?: string, preview?: Protocol.Runtime.ObjectPreview, customPreview?: Protocol.Runtime.CustomPreview,
305-
className?: string) {
302+
runtimeModel: RuntimeModel,
303+
objectId: Protocol.Runtime.RemoteObjectId|undefined,
304+
type: string,
305+
subtype: string|undefined,
306+
value: typeof RemoteObject.prototype.value,
307+
unserializableValue?: string,
308+
description?: string,
309+
preview?: Protocol.Runtime.ObjectPreview,
310+
customPreview?: Protocol.Runtime.CustomPreview,
311+
className?: string,
312+
) {
306313
super();
307314

308315
this.runtimeModelInternal = runtimeModel;

front_end/panels/elements/StylePropertiesSection.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1162,7 +1162,7 @@ export class StylePropertiesSection {
11621162
}
11631163

11641164
static renderSelectors(
1165-
selectors: Array<{text: string, specificity: Protocol.CSS.Specificity|undefined}>, matchingSelectors: boolean[],
1165+
selectors: Array<{text: string, specificity?: Protocol.CSS.Specificity}>, matchingSelectors: boolean[],
11661166
elementToSelectorIndex: WeakMap<Element, number>): DocumentFragment {
11671167
const fragment = document.createDocumentFragment();
11681168
for (const [i, selector] of selectors.entries()) {

0 commit comments

Comments
 (0)