Skip to content

Commit 606988b

Browse files
Lightning00BladeDevtools-frontend LUCI CQ
authored andcommitted
Remove internal suffixes from most of the files
This was done via a fixer and EsLint, the rule doesn't work 100% correctly so I will not submit it. There were some places that needed to be reverted as they were used in WebTest and those test are hard to migrate. Bug: none Change-Id: I5eb031f8f5b86163c0e5b9515ab72e7a0fcf7b08 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6867869 Commit-Queue: Nikolay Vitkov <[email protected]> Auto-Submit: Nikolay Vitkov <[email protected]> Reviewed-by: Ergün Erdoğmuş <[email protected]>
1 parent 151c223 commit 606988b

File tree

158 files changed

+2879
-2929
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

158 files changed

+2879
-2929
lines changed

front_end/core/common/Color.ts

Lines changed: 40 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1952,25 +1952,21 @@ export class Nickname extends ShortFormatColorBase {
19521952

19531953
export class Legacy implements Color {
19541954
readonly #rawParams: Color3D;
1955-
#rgbaInternal: Color4D;
1955+
#rgba: Color4D;
19561956
readonly #authoredText: string|null;
1957-
#formatInternal: LegacyColor;
1957+
#format: LegacyColor;
19581958
readonly channels: [ColorChannel, ColorChannel, ColorChannel, ColorChannel] =
19591959
[ColorChannel.R, ColorChannel.G, ColorChannel.B, ColorChannel.ALPHA];
19601960

19611961
static readonly #conversions: ColorConversions<Legacy> = {
1962-
[Format.HEX]: (self: Legacy) => new Legacy(self.#rgbaInternal, Format.HEX),
1963-
[Format.HEXA]: (self: Legacy) => new Legacy(self.#rgbaInternal, Format.HEXA),
1964-
[Format.RGB]: (self: Legacy) => new Legacy(self.#rgbaInternal, Format.RGB),
1965-
[Format.RGBA]: (self: Legacy) => new Legacy(self.#rgbaInternal, Format.RGBA),
1966-
[Format.HSL]: (self: Legacy) =>
1967-
new HSL(...rgbToHsl([self.#rgbaInternal[0], self.#rgbaInternal[1], self.#rgbaInternal[2]]), self.alpha),
1968-
[Format.HSLA]: (self: Legacy) =>
1969-
new HSL(...rgbToHsl([self.#rgbaInternal[0], self.#rgbaInternal[1], self.#rgbaInternal[2]]), self.alpha),
1970-
[Format.HWB]: (self: Legacy) =>
1971-
new HWB(...rgbToHwb([self.#rgbaInternal[0], self.#rgbaInternal[1], self.#rgbaInternal[2]]), self.alpha),
1972-
[Format.HWBA]: (self: Legacy) =>
1973-
new HWB(...rgbToHwb([self.#rgbaInternal[0], self.#rgbaInternal[1], self.#rgbaInternal[2]]), self.alpha),
1962+
[Format.HEX]: (self: Legacy) => new Legacy(self.#rgba, Format.HEX),
1963+
[Format.HEXA]: (self: Legacy) => new Legacy(self.#rgba, Format.HEXA),
1964+
[Format.RGB]: (self: Legacy) => new Legacy(self.#rgba, Format.RGB),
1965+
[Format.RGBA]: (self: Legacy) => new Legacy(self.#rgba, Format.RGBA),
1966+
[Format.HSL]: (self: Legacy) => new HSL(...rgbToHsl([self.#rgba[0], self.#rgba[1], self.#rgba[2]]), self.alpha),
1967+
[Format.HSLA]: (self: Legacy) => new HSL(...rgbToHsl([self.#rgba[0], self.#rgba[1], self.#rgba[2]]), self.alpha),
1968+
[Format.HWB]: (self: Legacy) => new HWB(...rgbToHwb([self.#rgba[0], self.#rgba[1], self.#rgba[2]]), self.alpha),
1969+
[Format.HWBA]: (self: Legacy) => new HWB(...rgbToHwb([self.#rgba[0], self.#rgba[1], self.#rgba[2]]), self.alpha),
19741970
[Format.LCH]: (self: Legacy) =>
19751971
new LCH(...ColorConverter.labToLch(...ColorConverter.xyzd50ToLab(...self.#toXyzd50())), self.alpha),
19761972
[Format.OKLCH]: (self: Legacy) => new Oklch(...ColorConverter.xyzd50ToOklch(...self.#toXyzd50()), self.alpha),
@@ -1997,15 +1993,15 @@ export class Legacy implements Color {
19971993
};
19981994

19991995
#toXyzd50(): Color3D {
2000-
const [r, g, b] = this.#rgbaInternal;
1996+
const [r, g, b] = this.#rgba;
20011997
return ColorConverter.srgbToXyzd50(r, g, b);
20021998
}
20031999

20042000
get alpha(): number|null {
20052001
switch (this.format()) {
20062002
case Format.HEXA:
20072003
case Format.RGBA:
2008-
return this.#rgbaInternal[3];
2004+
return this.#rgba[3];
20092005
default:
20102006
return null;
20112007
}
@@ -2022,7 +2018,7 @@ export class Legacy implements Color {
20222018

20232019
shortHex(): ShortHex|null {
20242020
for (let i = 0; i < 4; ++i) {
2025-
const c = Math.round(this.#rgbaInternal[i] * 255);
2021+
const c = Math.round(this.#rgba[i] * 255);
20262022
// Check if the two digits of each are identical: #aabbcc => #abc
20272023
if (c % 0x11) {
20282024
return null;
@@ -2033,10 +2029,10 @@ export class Legacy implements Color {
20332029

20342030
constructor(rgba: Color3D|Color4DOr3D, format: LegacyColor, authoredText?: string) {
20352031
this.#authoredText = authoredText || null;
2036-
this.#formatInternal = format;
2032+
this.#format = format;
20372033
this.#rawParams = [rgba[0], rgba[1], rgba[2]];
20382034

2039-
this.#rgbaInternal = [
2035+
this.#rgba = [
20402036
clamp(rgba[0], {min: 0, max: 1}),
20412037
clamp(rgba[1], {min: 0, max: 1}),
20422038
clamp(rgba[2], {min: 0, max: 1}),
@@ -2099,11 +2095,11 @@ export class Legacy implements Color {
20992095
}
21002096

21012097
format(): LegacyColor {
2102-
return this.#formatInternal;
2098+
return this.#format;
21032099
}
21042100

21052101
hasAlpha(): boolean {
2106-
return this.#rgbaInternal[3] !== 1;
2102+
return this.#rgba[3] !== 1;
21072103
}
21082104

21092105
detectHEXFormat(): Format {
@@ -2115,11 +2111,11 @@ export class Legacy implements Color {
21152111
if (format) {
21162112
return this.as(format).asString();
21172113
}
2118-
return this.#stringify(format, this.#rgbaInternal[0], this.#rgbaInternal[1], this.#rgbaInternal[2]);
2114+
return this.#stringify(format, this.#rgba[0], this.#rgba[1], this.#rgba[2]);
21192115
}
21202116
#stringify(format: LegacyColor|undefined, r: number, g: number, b: number): string {
21212117
if (!format) {
2122-
format = this.#formatInternal;
2118+
format = this.#format;
21232119
}
21242120

21252121
function toHexValue(value: number): string {
@@ -2132,15 +2128,15 @@ export class Legacy implements Color {
21322128
case Format.RGBA: {
21332129
const start = Platform.StringUtilities.sprintf('rgb(%d %d %d', toRgbValue(r), toRgbValue(g), toRgbValue(b));
21342130
if (this.hasAlpha()) {
2135-
return start + Platform.StringUtilities.sprintf(' / %d%)', Math.round(this.#rgbaInternal[3] * 100));
2131+
return start + Platform.StringUtilities.sprintf(' / %d%)', Math.round(this.#rgba[3] * 100));
21362132
}
21372133
return start + ')';
21382134
}
21392135
case Format.HEX:
21402136
case Format.HEXA: {
21412137
if (this.hasAlpha()) {
21422138
return Platform.StringUtilities
2143-
.sprintf('#%s%s%s%s', toHexValue(r), toHexValue(g), toHexValue(b), toHexValue(this.#rgbaInternal[3]))
2139+
.sprintf('#%s%s%s%s', toHexValue(r), toHexValue(g), toHexValue(b), toHexValue(this.#rgba[3]))
21442140
.toLowerCase();
21452141
}
21462142
return Platform.StringUtilities.sprintf('#%s%s%s', toHexValue(r), toHexValue(g), toHexValue(b)).toLowerCase();
@@ -2162,20 +2158,20 @@ export class Legacy implements Color {
21622158
}
21632159
isGamutClipped(): boolean {
21642160
return !equals(
2165-
this.#rawParams.map(toRgbValue),
2166-
[this.#rgbaInternal[0], this.#rgbaInternal[1], this.#rgbaInternal[2]].map(toRgbValue), WIDE_RANGE_EPSILON);
2161+
this.#rawParams.map(toRgbValue), [this.#rgba[0], this.#rgba[1], this.#rgba[2]].map(toRgbValue),
2162+
WIDE_RANGE_EPSILON);
21672163
}
21682164

21692165
rgba(): Color4D {
2170-
return [...this.#rgbaInternal];
2166+
return [...this.#rgba];
21712167
}
21722168

21732169
canonicalRGBA(): Color4D {
21742170
const rgba = new Array(4);
21752171
for (let i = 0; i < 3; ++i) {
2176-
rgba[i] = Math.round(this.#rgbaInternal[i] * 255);
2172+
rgba[i] = Math.round(this.#rgba[i] * 255);
21772173
}
2178-
rgba[3] = this.#rgbaInternal[3];
2174+
rgba[3] = this.#rgba[3];
21792175
return rgba as Color4D;
21802176
}
21812177

@@ -2200,10 +2196,10 @@ export class Legacy implements Color {
22002196

22012197
invert(): Legacy {
22022198
const rgba: Color4D = [0, 0, 0, 0];
2203-
rgba[0] = 1 - this.#rgbaInternal[0];
2204-
rgba[1] = 1 - this.#rgbaInternal[1];
2205-
rgba[2] = 1 - this.#rgbaInternal[2];
2206-
rgba[3] = this.#rgbaInternal[3];
2199+
rgba[0] = 1 - this.#rgba[0];
2200+
rgba[1] = 1 - this.#rgba[1];
2201+
rgba[2] = 1 - this.#rgba[2];
2202+
rgba[3] = this.#rgba[3];
22072203
return new Legacy(rgba, Format.RGBA);
22082204
}
22092205

@@ -2212,38 +2208,38 @@ export class Legacy implements Color {
22122208
* Note: We override with an alpha of 50% to enhance the dimming effect.
22132209
*/
22142210
grayscale(): Legacy {
2215-
const [r, g, b] = this.#rgbaInternal;
2211+
const [r, g, b] = this.#rgba;
22162212
const gray = r * 0.299 + g * 0.587 + b * 0.114;
22172213
return new Legacy([gray, gray, gray, 0.5], Format.RGBA);
22182214
}
22192215

22202216
setAlpha(alpha: number): Legacy {
2221-
const rgba: Color4D = [...this.#rgbaInternal];
2217+
const rgba: Color4D = [...this.#rgba];
22222218
rgba[3] = alpha;
22232219
return new Legacy(rgba, Format.RGBA);
22242220
}
22252221

22262222
blendWith(fgColor: Legacy): Legacy {
2227-
const rgba: Color4D = blendColors(fgColor.#rgbaInternal, this.#rgbaInternal);
2223+
const rgba: Color4D = blendColors(fgColor.#rgba, this.#rgba);
22282224
return new Legacy(rgba, Format.RGBA);
22292225
}
22302226

22312227
blendWithAlpha(alpha: number): Legacy {
2232-
const rgba: Color4D = [...this.#rgbaInternal];
2228+
const rgba: Color4D = [...this.#rgba];
22332229
rgba[3] *= alpha;
22342230
return new Legacy(rgba, Format.RGBA);
22352231
}
22362232

22372233
setFormat(format: LegacyColor): void {
2238-
this.#formatInternal = format;
2234+
this.#format = format;
22392235
}
22402236

22412237
equal(other: Color): boolean {
2242-
const legacy = other.as(this.#formatInternal);
2243-
return equals(toRgbValue(this.#rgbaInternal[0]), toRgbValue(legacy.#rgbaInternal[0]), WIDE_RANGE_EPSILON) &&
2244-
equals(toRgbValue(this.#rgbaInternal[1]), toRgbValue(legacy.#rgbaInternal[1]), WIDE_RANGE_EPSILON) &&
2245-
equals(toRgbValue(this.#rgbaInternal[2]), toRgbValue(legacy.#rgbaInternal[2]), WIDE_RANGE_EPSILON) &&
2246-
equals(this.#rgbaInternal[3], legacy.#rgbaInternal[3]);
2238+
const legacy = other.as(this.#format);
2239+
return equals(toRgbValue(this.#rgba[0]), toRgbValue(legacy.#rgba[0]), WIDE_RANGE_EPSILON) &&
2240+
equals(toRgbValue(this.#rgba[1]), toRgbValue(legacy.#rgba[1]), WIDE_RANGE_EPSILON) &&
2241+
equals(toRgbValue(this.#rgba[2]), toRgbValue(legacy.#rgba[2]), WIDE_RANGE_EPSILON) &&
2242+
equals(this.#rgba[3], legacy.#rgba[3]);
22472243
}
22482244
}
22492245

front_end/core/common/Console.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ import {reveal} from './Revealer.js';
88
let consoleInstance: Console|undefined;
99

1010
export class Console extends ObjectWrapper<EventTypes> {
11-
readonly #messagesInternal: Message[];
11+
readonly #messages: Message[];
1212
/**
1313
* Instantiable via the instance() factory below.
1414
*/
1515
constructor() {
1616
super();
17-
this.#messagesInternal = [];
17+
this.#messages = [];
1818
}
1919

2020
static instance(opts?: {forceNew: boolean}): Console {
@@ -39,7 +39,7 @@ export class Console extends ObjectWrapper<EventTypes> {
3939
*/
4040
addMessage(text: string, level = MessageLevel.INFO, show = false, source?: FrontendMessageSource): void {
4141
const message = new Message(text, level, Date.now(), show, source);
42-
this.#messagesInternal.push(message);
42+
this.#messages.push(message);
4343
this.dispatchEventToListeners(Events.MESSAGE_ADDED, message);
4444
}
4545

@@ -62,7 +62,7 @@ export class Console extends ObjectWrapper<EventTypes> {
6262
}
6363

6464
messages(): Message[] {
65-
return this.#messagesInternal;
65+
return this.#messages;
6666
}
6767

6868
show(): void {

front_end/core/common/ParsedURL.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ export class ParsedURL {
9595
folderPathComponents: string;
9696
lastPathComponent: string;
9797
readonly blobInnerScheme: string|undefined;
98-
#displayNameInternal?: string;
99-
#dataURLDisplayNameInternal?: string;
98+
#displayName?: string;
99+
#dataURLDisplayName?: string;
100100

101101
constructor(url: string) {
102102
this.isValid = false;
@@ -494,8 +494,8 @@ export class ParsedURL {
494494
}
495495

496496
get displayName(): string {
497-
if (this.#displayNameInternal) {
498-
return this.#displayNameInternal;
497+
if (this.#displayName) {
498+
return this.#displayName;
499499
}
500500

501501
if (this.isDataURL()) {
@@ -508,25 +508,25 @@ export class ParsedURL {
508508
return this.url;
509509
}
510510

511-
this.#displayNameInternal = this.lastPathComponent;
512-
if (!this.#displayNameInternal) {
513-
this.#displayNameInternal = (this.host || '') + '/';
511+
this.#displayName = this.lastPathComponent;
512+
if (!this.#displayName) {
513+
this.#displayName = (this.host || '') + '/';
514514
}
515-
if (this.#displayNameInternal === '/') {
516-
this.#displayNameInternal = this.url;
515+
if (this.#displayName === '/') {
516+
this.#displayName = this.url;
517517
}
518-
return this.#displayNameInternal;
518+
return this.#displayName;
519519
}
520520

521521
dataURLDisplayName(): string {
522-
if (this.#dataURLDisplayNameInternal) {
523-
return this.#dataURLDisplayNameInternal;
522+
if (this.#dataURLDisplayName) {
523+
return this.#dataURLDisplayName;
524524
}
525525
if (!this.isDataURL()) {
526526
return '';
527527
}
528-
this.#dataURLDisplayNameInternal = Platform.StringUtilities.trimEndWithMaxLength(this.url, 20);
529-
return this.#dataURLDisplayNameInternal;
528+
this.#dataURLDisplayName = Platform.StringUtilities.trimEndWithMaxLength(this.url, 20);
529+
return this.#dataURLDisplayName;
530530
}
531531

532532
isAboutBlank(): boolean {

front_end/core/common/Progress.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const CompositeProgress = Common.Progress.CompositeProgress;
88
const ProgressProxy = Common.Progress.ProgressProxy;
99

1010
class MockProgressIndicator implements Common.Progress.Progress {
11-
private isCanceledInternal = false;
11+
#isCanceled = false;
1212
private totalWork = 0;
1313
private workCompleted = 0;
1414
private title!: string|undefined;
@@ -26,7 +26,7 @@ class MockProgressIndicator implements Common.Progress.Progress {
2626
}
2727

2828
isCanceled() {
29-
return this.isCanceledInternal;
29+
return this.#isCanceled;
3030
}
3131

3232
done() {
@@ -54,7 +54,7 @@ class MockProgressIndicator implements Common.Progress.Progress {
5454

5555
// Test methods.
5656
cancel() {
57-
this.isCanceledInternal = true;
57+
this.#isCanceled = true;
5858
}
5959
}
6060

0 commit comments

Comments
 (0)